Local time object

  • Represents time in day without timezone.

Hierarchy

  • LocalTime

Constructors

Properties

Methods

Constructors

  • Throws

    TypeError if any of the arguments are invalid

    Throws

    RangeError if value of 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 LocalTime

Properties

hour: number

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

minute: number

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

nano: number

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

second: number

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

Methods

  • Returns the string representation of this local time.

    Returns

    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.

    Returns string

  • Constructs a new instance from Date.

    Throws

    TypeError if the passed param is not a Date

    Throws

    RangeError if an invalid Date is passed

    Parameters

    • date: Date

      must be a valid Date. date.getTime() should be not NaN

    Returns LocalTime

  • Constructs a new LocalTime object from timeString.

    Throws

    RangeError if given timeString is invalid

    Throws

    TypeError if given argument is not string

    Parameters

    • timeString: string

      A string in the form HH:mm:ss.SSS, where the last part represents nanoseconds and optional. At most 9 digits allowed for nanosecond value. If more than 9 digits are given, the first 9 of them are used.

    Returns LocalTime

Generated using TypeDoc