Functions for date and time manipulation.
datetime | Functions for date and time manipulation. |
Types | |
Instant | Represents a particular instant in global time. |
DateTime | Represents a particular instant in global time, broken down to components in UTC. |
Interval | Represents a time period between a start and an end time. |
Duration | Represents a specific amount of time measured in seconds. |
Period | Represents an amount of time measured by components. |
Functions | |
now | Return the current timestamp as a DateTime. |
makeFromInstant | Convert a specific instant into a DateTime record. |
makeFromParts | Given timestamp parts, return a DateTime representing the instant. |
makeFromString | Make a DateTime from a string representation. |
DateTime. | Subtract a Duration from a DateTime and return a new DateTime. |
DateTime. | Subtract a Period from a DateTime and return a new DateTime. |
DateTime. | Add a Duration to a DateTime and return a new DateTime. |
DateTime. | Add a Period to a DateTime and return a new DateTime. |
DateTime. | Return an ISO 8601 formatted representation of a DateTime. |
DateTime. | Return a new DateTime with the given year, month, and day based on an existing DateTime. |
DateTime. | Return a new DateTime with the given year based on an existing DateTime. |
DateTime. | Return a new DateTime with the given month based on an existing DateTime. |
DateTime. | Return a new DateTime with the given day based on an existing DateTime. |
DateTime. | Return a new DateTime with the given hour, minute, and second based on an existing DateTime. |
DateTime. | Return a new DateTime with the given hour based on an existing DateTime. |
DateTime. | Return a new DateTime with the given minute based on an existing DateTime. |
DateTime. | Return a new DateTime with the given second based on an existing DateTime. |
FUNCTION now(): DateTime
Return the current timestamp as a DateTime.
FUNCTION makeFromInstant( inst: Instant ): DateTime
Convert a specific instant into a DateTime record.
FUNCTION makeFromParts( dt: DateTime ): DateTime
Given timestamp parts, return a DateTime representing the instant. This function must be called after filling in an empty DateTime.
FUNCTION DateTime.toString( self: DateTime ): String
Return an ISO 8601 formatted representation of a DateTime.
FUNCTION DateTime.withDate( self: DateTime, year, month, day: Number ): DateTime
Return a new DateTime with the given year, month, and day based on an existing DateTime.
FUNCTION DateTime.withYear( self: DateTime, year: Number ): DateTime
Return a new DateTime with the given year based on an existing DateTime.
FUNCTION DateTime.withMonth( self: DateTime, month: Number ): DateTime
Return a new DateTime with the given month based on an existing DateTime.
FUNCTION DateTime.withDay( self: DateTime, day: Number ): DateTime
Return a new DateTime with the given day based on an existing DateTime.
FUNCTION DateTime.withTime( self: DateTime, hour, minute, second: Number ): DateTime
Return a new DateTime with the given hour, minute, and second based on an existing DateTime.
FUNCTION DateTime.withHour( self: DateTime, hour: Number ): DateTime
Return a new DateTime with the given hour based on an existing DateTime.
FUNCTION DateTime.withMinute( self: DateTime, minute: Number ): DateTime
Return a new DateTime with the given minute based on an existing DateTime.
FUNCTION DateTime.withSecond( self: DateTime, second: Number ): DateTime
Return a new DateTime with the given second based on an existing DateTime.
Return the current timestamp as a DateTime.
FUNCTION now(): DateTime
Convert a specific instant into a DateTime record.
FUNCTION makeFromInstant( inst: Instant ): DateTime
Given timestamp parts, return a DateTime representing the instant.
FUNCTION makeFromParts( dt: DateTime ): DateTime
Make a DateTime from a string representation.
FUNCTION makeFromString( s: String ): DateTime
Subtract a Duration from a DateTime and return a new DateTime.
FUNCTION DateTime.minusDuration( self: DateTime, duration: Duration ): DateTime
Subtract a Period from a DateTime and return a new DateTime.
FUNCTION DateTime.minusPeriod( self: DateTime, period: Period ): DateTime
Add a Duration to a DateTime and return a new DateTime.
FUNCTION DateTime.plusDuration( self: DateTime, duration: Duration ): DateTime
Add a Period to a DateTime and return a new DateTime.
FUNCTION DateTime.plusPeriod( self: DateTime, period: Period ): DateTime
Return an ISO 8601 formatted representation of a DateTime.
FUNCTION DateTime.toString( self: DateTime ): String
Return a new DateTime with the given year, month, and day based on an existing DateTime.
FUNCTION DateTime.withDate( self: DateTime, year, month, day: Number ): DateTime
Return a new DateTime with the given year based on an existing DateTime.
FUNCTION DateTime.withYear( self: DateTime, year: Number ): DateTime
Return a new DateTime with the given month based on an existing DateTime.
FUNCTION DateTime.withMonth( self: DateTime, month: Number ): DateTime
Return a new DateTime with the given day based on an existing DateTime.
FUNCTION DateTime.withDay( self: DateTime, day: Number ): DateTime
Return a new DateTime with the given hour, minute, and second based on an existing DateTime.
FUNCTION DateTime.withTime( self: DateTime, hour, minute, second: Number ): DateTime
Return a new DateTime with the given hour based on an existing DateTime.
FUNCTION DateTime.withHour( self: DateTime, hour: Number ): DateTime
Return a new DateTime with the given minute based on an existing DateTime.
FUNCTION DateTime.withMinute( self: DateTime, minute: Number ): DateTime
Return a new DateTime with the given second based on an existing DateTime.
FUNCTION DateTime.withSecond( self: DateTime, second: Number ): DateTime