DateTime
A DateTime value represents a specific point of time. It has all the same features of Date but with the time components hour, minute and second added.
Related commands
setDateTime
Allows new DateTime values to be created within the logic, such as very easy creation of the date and time on which the logic is being run.setDateTimeFormat
Used for creating DateTime formats that allow wide customization of how DateTime values are converted into Strings to be displayed on document.setDateTimeParser
A DateTime parser created by this command can be used to convert Strings into DateTimes.
Methods
Being an extension of the Date value type, DateTime has all the methods of Date in addition to the ones listed here.
getHourOfDay() | Resolves into a Number telling the hour of this DateTime. For example, the expression Using the shorthand form the expression becomes |
getMinuteOfDay() / getMinuteOfHour() | These two methods resolve into a Number representing the minute of the DateTime in different contexts. For example, the expression Using the shorthand form the expression becomes |
getSecondOfDay() / getSecondOfMinute() | These two methods resolve into a Number representing the second of the DateTime in different contexts. For example, the expression Using the shorthand form the expression becomes |
minusHours(value) / minusMinutes(value) / minusSeconds(value) | A set of methods that resolve into a new DateTime that is this DateTime but with the specified number of hours/minutes/seconds earlier in time. For example, the expression |
plusHours(value) / plusMinutes(value) / plusSeconds(value) | A set of methods that resolve into a new DateTime that is this DateTime but with the specified number of hours/minutes/seconds later in time. For example, the expression |
withHour(value) / withMinute(value) / withSecond(value) | A set of methods that resolve into a new DateTime that is this DateTime but with the hour/minute/second set to the specified number. For example, the expression |