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: Integer | number | undefined): Time

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

Constructor Summary

Public Constructor
public

constructor(hour: Integer | number, minute: Integer | number, second: Integer | number, nanosecond: Integer | number, timeZoneOffsetSeconds: Integer | number)

Member Summary

Public Members
public

hour: Integer | number

The hour.

public

minute: Integer | number

The minute.

public

nanosecond: Integer | number

The nanosecond.

public

second: Integer | number

The second.

public

The time zone offset in seconds.

Static Public Methods

public static fromStandardDate(standardDate: global.Date, nanosecond: Integer | number | undefined): Time 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 Integer | number | undefined

The optional amount of nanoseconds.

Return:

Time

New Time.

Public Constructors

public constructor(hour: Integer | number, minute: Integer | number, second: Integer | number, nanosecond: Integer | number, timeZoneOffsetSeconds: Integer | number) source

Params:

NameTypeAttributeDescription
hour Integer | number

The hour for the new local time.

minute Integer | number

The minute for the new local time.

second Integer | number

The second for the new local time.

nanosecond Integer | number

The nanosecond for the new local time.

timeZoneOffsetSeconds Integer | number

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: Integer | number source

The hour.

public minute: Integer | number source

The minute.

public nanosecond: Integer | number source

The nanosecond.

public second: Integer | number source

The second.

public timeZoneOffsetSeconds: Integer | number source

The time zone offset in seconds.