Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TZUtils

Hierarchy

  • TZUtils

Index

Properties

Static DEFAULT_OFFSET

DEFAULT_OFFSET: number = 0

The default timezone offset if UTC_OFFSET is not set in Config.

readonly

Static ENV_OFFSET

ENV_OFFSET: string = "UTC_OFFSET"

Name of value read from Config to determine initial timezone if present.

readonly

Static FORMAT_TIMESTAMP

FORMAT_TIMESTAMP: string = "YYYY-MM-DD HH:mm:ss,SSS"

The default format used when calling TZUtils.timestamp.

readonly

Accessors

Static now

  • get now(): Date

Static timezoneOffset

  • get timezoneOffset(): number
  • set timezoneOffset(minutes: number): void
  • The current offset in minutes from UTC. May be positive or negative.

    Returns number

  • The current offset in minutes from UTC. May be positive or negative.

    Parameters

    • minutes: number

    Returns void

Methods

Static timestamp

  • timestamp(format?: string): string
  • Returns the current timestamp as a string. The actual value depends on both the TZUtils.timezoneOffset and the optionally provided format.

    • Please see the date-fns project for details about the valid values for the format string.

    Parameters

    • Default value format: string = this.FORMAT_TIMESTAMP

      The optional date-fns style format for the output.

    Returns string

Generated using TypeDoc