Function formatUTCDateTime

  • Format the date object to UTC and according to the specified string token.

    Current string tokens are specified in DateFormat enum. More info about tokens: https://moment.github.io/luxon/docs/manual/formatting

    Example

    formatUTCDateTime(new Date(2020, 1, 1, 8), DateFormat.MMM_DD_YYYY) // "Feb 01, 2020"
    formatUTCDateTime(new Date(2020, 1, 1, 20), DateFormat.MMM_DD_YYYY) // "Feb 02, 2020"
    (Feb 1st 2020 at 8 pm. Pacific when converted to UTC will become Feb 2nd)

    Returns

    Date string in the specified format

    Parameters

    • date: Date

      JavaScript date object

    • format: DateFormat

      String token representing the desired date format

    Returns string

Generated using TypeDoc