Options
All
  • Public
  • Public/Protected
  • All
Menu

Module util/DatetimeUtil

Index

Functions

getLocalDateString

  • getLocalDateString(year: number, month: number, date: number): string
  • Returns the string representation of a local date.

    throws

    RangeError if any of the arguments are invalid

    Parameters

    • year: number

      Must be between -999999999-999999999

    • month: number

      Must be between 1-12

    • date: number

      Must be between 1-31 depending on year and month

    Returns string

    A string in the form yyyy-mm-dd. Values are zero padded from left

getLocalTimeString

  • getLocalTimeString(hour: number, minute: number, second: number, nano: number): string
  • Returns the string representation of a local time.

    throws

    RangeError if any of the arguments are invalid

    Parameters

    • hour: number

      The hour-of-day to represent, from 0 to 23

    • minute: number

      The minute-of-hour to represent, from 0 to 59

    • second: number

      The second-of-minute to represent, from 0 to 59

    • nano: number

      The nano-of-second to represent, from 0 to 999,999,999

    Returns string

    A string in the form HH:mm:ss.SSS (9 digits, nano second precision). The constructed string is zero-padded from left. If nanosecond is 0, it is not included in the constructed string.

Generated using TypeDoc