Home Reference Source
public class | source

Time

Represents an instant capturing the time of day, and the timezone offset in seconds, but not the date. Created Time objects are frozen with Object.freeze() in constructor and thus immutable.

Static Method Summary

Static Public Methods
public static

fromStandardDate(standardDate: global.Date, nanosecond: NumberOrInteger | undefined): Time<number>

Create a Time object from the given standard JavaScript Date and optional nanoseconds.

Constructor Summary

Public Constructor
public

constructor(hour: NumberOrInteger, minute: NumberOrInteger, second: NumberOrInteger, nanosecond: NumberOrInteger, timeZoneOffsetSeconds: NumberOrInteger)

Member Summary

Public Members
public

hour: NumberOrInteger

The hour.

public

minute: NumberOrInteger

The minute.

public

nanosecond: NumberOrInteger

The nanosecond.

public

second: NumberOrInteger

The second.

public

timeZoneOffsetSeconds: NumberOrInteger

The time zone offset in seconds.

Static Public Methods

public static fromStandardDate(standardDate: global.Date, nanosecond: NumberOrInteger | undefined): Time<number> source

Create a Time object from the given standard JavaScript Date and optional nanoseconds. Year, month and day components of the given date are ignored.

Params:

NameTypeAttributeDescription
standardDate global.Date

The standard JavaScript date to convert.

nanosecond NumberOrInteger | undefined

The optional amount of nanoseconds.

Return:

Time<number>

New Time.

Public Constructors

public constructor(hour: NumberOrInteger, minute: NumberOrInteger, second: NumberOrInteger, nanosecond: NumberOrInteger, timeZoneOffsetSeconds: NumberOrInteger) source

Params:

NameTypeAttributeDescription
hour NumberOrInteger

The hour for the new local time.

minute NumberOrInteger

The minute for the new local time.

second NumberOrInteger

The second for the new local time.

nanosecond NumberOrInteger

The nanosecond for the new local time.

timeZoneOffsetSeconds NumberOrInteger

The time zone offset in seconds. Value represents the difference, in seconds, from UTC to local time. This is different from standard JavaScript Date.getTimezoneOffset() which is the difference, in minutes, from local time to UTC.

Public Members

public hour: NumberOrInteger source

The hour.

public minute: NumberOrInteger source

The minute.

public nanosecond: NumberOrInteger source

The nanosecond.

public second: NumberOrInteger source

The second.

public timeZoneOffsetSeconds: NumberOrInteger source

The time zone offset in seconds.