The datetime object represents a combined date and time value and includes properties, and functions to extract numbers, convert between local and UTC, and convert to a string representation. Note that the local date and time value and formatting output is based on the timezone and regional settings of the server or agent where the expression is evaluated.
Name | Description | Parameters | Return Type | Usage Examples | |
---|---|---|---|---|---|
Day | The day component of the date/time | number | |||
DayOfWeek | The name of the day of week of the date/time | string | |||
DaysAgo | The number of days which have passed since the date/time | number | |||
Format | Formats a date or time value using standard or custom .Net formatting strings | string | $Server.Now.Format("hh:mm")$ | "23:55" (given the date time "31/12/2000 23:55:333") | |
Hour | The hour component of the date/time | number | |||
HoursAgo | The number of hours which have passed since the date/time | number | |||
Local | The date/time converted to local server time | DateTime | |||
Millisecond | The millisecond component of the date/time | number | |||
Minute | The minute component of the date/time | number | |||
MinutesAgo | The number of minutes which have passed since the date/time | number | |||
Month | The month component of the date/time | number | |||
Second | The second component of the date/time | number | |||
SecondsAgo | The number of seconds which have passed since the date/time | number | |||
ToLongDateString | The date/time represented in long date format. For the en-AU culture, the standard long date pattern is "dddd, d MMMM yyyy". | string | |||
ToLongTimeString | The date/time represented in long time format. For the en-AU culture, the standard long time pattern is "h:mm:ss tt". | string | |||
ToShortDateString | The date/time represented in short date format. For the en-AU culture, the standard short date pattern is "d/MM/yyyy" | string | |||
ToShortTimeString | The date/time represented in short time format. For the en-AU culture, the standard short time pattern is "h:mm tt" | string | |||
UTC | The date/time converted to Coordinated Universal Time (UTC) | DateTime | |||
Year | The year component of the date/time | number | |||