Skip to main content

getDateTimeLocal

Callable

  • getDateTimeLocal(timestamp?: Date): string

  • Returns a string representing the local date and time in ISO format, based on the provided timestamp or the current date and time if no timestamp is provided.

    @example
    // Returns the current date and time in ISO format
    getDateTimeLocal();

    // Returns the local date and time in ISO format for the provided timestamp
    getDateTimeLocal(new Date("2022-02-17T12:30:00Z"));