• Formats a date object to a date time string formatted as 07/21/2024, 12:37:01 PM, or if includeMs is set to true, 07/21/2024, 12:37:01.572 PM.

    Type Parameters

    • includeMs extends boolean = false

      Whether to include milliseconds in the formatted string. Default is false.

    Parameters

    • date: Date

      The date object to format.

    • OptionaltimeZoneOffset: number

      The time zone offset in minutes. Default is 0 (UTC).

    • OptionalincludeMs: includeMs

    Returns includeMs extends unknown
        ? | `${bigint}/${bigint}/${bigint}, ${bigint}:${bigint}:${bigint} AM`
        | `${bigint}/${bigint}/${bigint}, ${bigint}:${bigint}:${bigint} PM`
        : includeMs extends false
            ? | `${bigint}/${bigint}/${bigint}, ${bigint}:${bigint}:${bigint} AM`
            | `${bigint}/${bigint}/${bigint}, ${bigint}:${bigint}:${bigint} PM`
            : | `${bigint}/${bigint}/${bigint}, ${bigint}:${bigint}:${bigint}.${bigint} AM`
            | `${bigint}/${bigint}/${bigint}, ${bigint}:${bigint}:${bigint}.${bigint} PM`

    The formatted date time string.

    1.18.2-development.10

    1.1.1