Options
All
  • Public
  • Public/Protected
  • All
Menu

Local time object

  • Represents time in day without timezone.

Hierarchy

  • LocalTime

Index

Constructors

Properties

Methods

Constructors

constructor

  • new LocalTime(hour: number, minute: number, second: number, nano: number): LocalTime
  • 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

Readonly hour

hour: number

Readonly minute

minute: number

Readonly nano

nano: number

Readonly second

second: number

Methods

toString

  • toString(): string
  • Returns the string representation of this local time.

    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.

Static fromString

  • 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