Function isoDateTimestampForFilename

  • This function takes a date object and returns a string in ISO format suitable for filenames. If no date is provided, it uses the current date and time.

    Parameters

    • date: Date = ...

      The date object to be converted. Defaults to the current date and time.

    Returns string

    A string in the format "YYYY-MM-DD-HH-MM-SS-SSS".

    Example

    isoDateTimestampForFilename(new Date('2022-01-01T00:00:00Z'));;
    //=> "2022-01-01-00-00-00-000"

Generated using TypeDoc