@tremendous/help
    Preparing search index...

    Function formatTimestamp

    • Formats a date into a string with date and time.

      date-fns uses unicode tokens for formatting, which are admittedly less intuitive than Moment.js tokens, but more consistent across locales.

      By adopting Unicode tokens, date-fns aligns with the Unicode Technical Standard #35, which offers a standardized approach to date formatting. This alignment ensures that date representations are consistent across different platforms and locales, reducing discrepancies that can arise from varying custom formatting rules.

      https://date-fns.org/v4.1.0/docs/format https://date-fns.org/v4.1.0/docs/Unicode-Tokens

      Parameters

      • input: undefined | null | DateInput

        A string, native Date, or unix timestamp

      • Optionaloptions: Options

        The options for formatting.

      Returns string

      • The formatted date and time string.
      formatTimestamp("2025-03-21T16:21:00-04:00", { includeTimezone: true }); // "Mar 21, 2025 at 4:21 PM EDT"
      formatTimestamp(1742550060, { format: "yyyy-MM-dd HH:mm" }); // "2025-03-21 16:21" (example timestamp for Mar 21, 2025 4:21 PM EDT)