Function formatTime12hr

  • Formats a date to the 12-hour time format string 'hh:mm a'

    Parameters

    Returns string

    A string representing the formatted time in the 12-hour time format string 'hh:mm a'

    Example

    formatTime12hr(new Date());
    // => '12:00 am'

    formatTime12hr('2022-01-01T12:00:00Z');
    // => '12:00 am'

Generated using TypeDoc