Options
All
  • Public
  • Public/Protected
  • All
Menu

Local time object

  • Represents time in day without timezone.

Hierarchy

  • LocalTime

Index

Constructors

  • 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

hour: number
minute: number
nano: number
second: number

Methods

  • 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.

  • 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