Function Name | Description | Output Type | Parameters |
DateTime.addTime | Adds a time period to a date/time value. For date and time of day values, time zone is ignored; the arithmetic is done in a zone-less fashion. Additionally, it is an error to add units smaller than a day to date values or units larger than an hour to time of day values. | same as input | • Base date/time value • Duration of period • Granularity of period • Time zone (optional) |
DateTime.currentDate | Gets the current date. | date | Time zone (optional) |
DateTime.currentTime | Gets the current time of day. | time | Time zone (optional) |
DateTime.currentTimestamp | Gets the current date and time of day. | timestamp | Time zone (optional) |
DateTime.getValue (Rushscript: dateTimeValue) | Extracts the wanted date or time field from the input value. It is an error to attempt to extract time fields from a date value or date fields from a time of day value. | int | • Date/time value • Date/time field to extract • Time zone (optional) |
DateTime.getTextValue (Rushscript: dateTimeTextValue) | Extracts the wanted date or time field from the input value as human readable text. It is an error to attempt to extract time fields from a date value or date fields from a time of day value. | String | • Date/time value • Date/time field to extract • Time zone (optional) |
DateTime.subtractTime | Subtracts a time period from a date/time value. For date and time of day values, time zone is ignored; the arithmetic is done in a zone-less fashion. Additionally, it is an error to add units smaller than a day to date values or units larger than an hour to time of day values. | same as input | • Base date/time value • Duration of period • Granularity of period • Time zone (optional) |
DateTime.timeDiff | Computes the difference between two date/time values measured in a specified time unit and scale. Both values must be of the same type. When comparing time fields the highest precision is millisecond based whereas when comparing date fields the precision is day based. This means that when using date fields the difference will be based on the calendar intervals versus time fields which will use the more precise astronomical time intervals. | double | • Start date/time value • End date/time value • Granularity of difference • Scale of resultant value (optional) |
DateTime.toMilliseconds | Converts a date/time value into the number milliseconds since the epoch (January 1, 1970, 00:00:00 GMT). As time of day values have no date portion, this value will simply be the number of milliseconds since midnight. For date values, the result represents midnight of the associated day. | long | • Date/time value • Time zone (optional) |
DateTime.useDefaultTimeZone | Adjusts a timestamp value to use the default time zone offset. | timestamp | • Timestamp value |
DateTime.useTimeZone | Adjusts a timestamp value to use the time zone offset of the specified time zone. | timestamp | • Timestamp value • Time zone |