Home Reference Source
import {DateTime} from 'neo4j-driver/lib/temporal-types.js'
public class | source

DateTime

Represents an instant capturing the date, the time and the timezone identifier. Created {@ DateTime} 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): DateTime

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

Constructor Summary

Public Constructor
public

constructor(year: Integer | number, month: Integer | number, day: Integer | number, hour: Integer | number, minute: Integer | number, second: Integer | number, nanosecond: Integer | number, timeZoneOffsetSeconds: Integer | number, timeZoneId: string | null)

Member Summary

Public Members
public

day: Integer | number

The day.

public

hour: Integer | number

The hour.

public

minute: Integer | number

The minute.

public

month: Integer | number

The month.

public

nanosecond: Integer | number

The nanosecond.

public

second: Integer | number

The second.

public

timeZoneId: string

The time zone id.

public

The time zone offset in seconds.

public

year: Integer | number

The year.

Static Public Methods

public static fromStandardDate(standardDate: global.Date, nanosecond: Integer | number | undefined): DateTime source

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

Params:

NameTypeAttributeDescription
standardDate global.Date

The standard JavaScript date to convert.

nanosecond Integer | number | undefined

The optional amount of nanoseconds.

Return:

DateTime

New DateTime.

Public Constructors

public constructor(year: Integer | number, month: Integer | number, day: Integer | number, hour: Integer | number, minute: Integer | number, second: Integer | number, nanosecond: Integer | number, timeZoneOffsetSeconds: Integer | number, timeZoneId: string | null) source

Params:

NameTypeAttributeDescription
year Integer | number

The year for the new date-time.

month Integer | number

The month for the new date-time.

day Integer | number

The day for the new date-time.

hour Integer | number

The hour for the new date-time.

minute Integer | number

The minute for the new date-time.

second Integer | number

The second for the new date-time.

nanosecond Integer | number

The nanosecond for the new date-time.

timeZoneOffsetSeconds Integer | number

The time zone offset in seconds. Either this argument or timeZoneId should be defined. 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.

timeZoneId string | null

The time zone id for the new date-time. Either this argument or timeZoneOffsetSeconds should be defined.

Public Members

public day: Integer | number source

The day.

public hour: Integer | number source

The hour.

public minute: Integer | number source

The minute.

public month: Integer | number source

The month.

public nanosecond: Integer | number source

The nanosecond.

public second: Integer | number source

The second.

public timeZoneId: string source

The time zone id.

Either this or timeZoneOffsetSeconds is defined.

public timeZoneOffsetSeconds: Integer | number source

The time zone offset in seconds.

Either this or timeZoneId is defined.

public year: Integer | number source

The year.