@akashrajpurohit/utils
    Preparing search index...

    Function formatDateTime

    • Formats a date and time according to the specified options.

      Parameters

      • timestamp: string | number | Date

        The timestamp to format.

      • dateStyle: undefined | "long" | "short" | "medium" | "full" = 'medium'

        The date formatting style to use. Defaults to 'medium'.

      • timeStyle: undefined | "long" | "short" | "medium" | "full" = 'short'

        The time formatting style to use. Defaults to 'short'.

      • locale: string = 'en-US'

        The locale to use for formatting. Defaults to 'en'.

      Returns string

      The formatted date and time string.