Function formatDateTime

  • Format the date object 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

    formatDateTime(new Date(2020, 2, 1), DateFormat.YYYY_MM_DD)  // "2020-03-01"
    formatDateTime(new Date("2020-03-02T03:00:00Z"), DateFormat.MM_DD_YYYY) // "03/01/2020"

    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