halo - v1.0.0
    Preparing search index...

    Class Time

    Time utility class for handling date and time formatting. This class provides methods to format dates in various ways, including human-readable formats, ISO strings, and formats suitable for logging or saving to a database.

    Index

    Constructors

    Methods

    • Formats a date to a human-readable string.

      Parameters

      • data: { date?: Date; locale?: null | string; timeZone?: null | string }

      Returns string

      The formatted date string.

    • Returns the current time as a Date object. This method formats the current time to a string and then converts it back to a Date object.

      Parameters

      • Optionallocale: null | string
      • OptionaltimeZone: null | string

      Returns Date

    • Returns the current time in a human-readable format. This format is DD/MM/YYYY HH:MM:SS, which is suitable for display to users.

      Parameters

      • Optionallocale: null | string
      • OptionaltimeZone: null | string

      Returns string

    • Returns the current time formatted as a string suitable for saving. This format is YYYY-MM-DDTHH-MM-SSZ, which is useful for file naming or database storage.

      Parameters

      • Optionallocale: null | string
      • OptionaltimeZone: null | string

      Returns string

    • Returns the current time formatted as a string. This format is YYYY-MM-DDTHH:MM:SSZ, which is useful for logging or displaying the current time.

      Parameters

      • Optionallocale: null | string
      • OptionaltimeZone: null | string

      Returns string

    • Gets the system's default locale

      Returns string

    • Gets both system locale and timezone

      Returns { locale: string; timeZone: string }

    • Gets the system's default timezone

      Returns string

    • Returns the current time formatted for logging. This format is DD/MM/YYYY:HH:MM:SS, which is useful for log entries.

      Parameters

      • Optionallocale: null | string
      • OptionaltimeZone: null | string

      Returns string