Namespace: DateTime

DateTime

DateTime Utility Class
Source:

Methods

(static) format(dateopt, formatopt) → {LocalDateTime}

Format a Date object using a specific format
Parameters:
Name Type Attributes Description
date Date <optional>
the date object
format string <optional>
date format
Source:
Returns:
a date instance
Type
LocalDateTime

(static) now(timezoneopt) → {LocalDateTime}

Get the current date in a specific time zone
Parameters:
Name Type Attributes Description
timezone string <optional>
the timezone of the resulting date
Source:
Returns:
a date instance
Type
LocalDateTime

(static) of(date, date, date, date, date, secondopt, nanosecondopt) → {LocalDateTime}

Creates a LocalDateTime instance using year, month, day, hour, minute, second, nanosecond
Parameters:
Name Type Attributes Description
date integer year
date integer month
date integer day
date integer hour
date integer minute
second integer <optional>
date second
nanosecond integer <optional>
date nanosecond
Source:
Returns:
a date instance
Type
LocalDateTime

(static) parse(sdateopt, formatopt) → {LocalDateTime}

Creates a LocalDateTime instance by parsing a string using a specific date format
Parameters:
Name Type Attributes Description
sdate string <optional>
string representation of a date
format string <optional>
date format
Source:
Returns:
a date instance
Type
LocalDateTime

(static) utc(dateopt, formatopt) → {string}

Format a Date object in UTC yyyy-MM-dd'T'HH:mm:ss'Z'
Parameters:
Name Type Attributes Description
date Date <optional>
the date object
format string <optional>
date format
Source:
Returns:
the utc formatted date
Type
string

(static) withTimestamp(timestampopt, timezoneopt) → {LocalDateTime}

Get a date object corresponding to the timestamp in a specific time zone
Parameters:
Name Type Attributes Description
timestamp integer <optional>
the integere timestamp
timezone string <optional>
the timezone of the resulting date
Source:
Returns:
a date instance
Type
LocalDateTime