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 and Parameters | Description | Return Type | Usage Examples | |
---|---|---|---|---|
Day | The day component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Day$ | 31 |
DayOfWeek | The name of the day of week of the date/time | String | $Utils.GetDateTime("31/12/2000 23:55:33.222").DayOfWeek$ | "Sunday" |
DaysAgo | The number of days which have passed since the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").DaysAgo$ | 6525 |
Format(string format) | Formats a date or time value using standard or custom.Net formatting strings | String | $Utils.GetDateTime("31/12/2000 23:55:33.222").Hour: $Utils.GetDateTime("31/ | "31 Dec 2000 11:55" |
Hour | The hour component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Hour$ | 23 |
HoursAgo | The number of hours which have passed since the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").HoursAgo$ | 156616 |
Local | The date/time converted to local server time | DateTime | $Utils.GetDateTime("31/12/2000 23:55:33.222").Local$ | "31/12/2000 23:55:33" |
Millisecond | The millisecond component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Millisecond$ | 222 |
Minute | The minute component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Minute$ | 55 |
MinutesAgo | The number of minutes which have passed since the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").MinutesAgo$ | 9396972 |
Month | The month component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Month$ | 12 |
Second | The second component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Second$ | 33 |
SecondsAgo | The number of seconds which have passed since the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").SecondsAgo$ | 563818361 |
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 | $Utils.GetDateTime("31/12/2000 23:55:33.222").ToLongDateString()$ | "Sunday, 31 December 2000" |
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 | $Utils.GetDateTime("31/12/2000 23:55:33.222").ToLongTimeString()$ | "23:55:33" |
ToShortDateString() | The date/time represented in short date format. For the en-AU culture, the standard short date pattern is "d/MM/yyyy" | String | Utils.GetDateTime("31/12/2000 23:55:33.222").ToShortDateString()$ | "31/12/2000" |
ToShortTimeString() | The date/time represented in short time format. For the en-AU culture, the standard short time pattern is "h:mm tt" | String | $Utils.GetDateTime("31/12/2000 23:55:33.222").ToShortTimeString()$ | "23:55" |
UTC | The date/time converted to Coordinated Universal Time (UTC) | DateTime | $Utils.GetDateTime("31/12/2000 23:55:33.222").UTC$ | "31/12/2000 12:55:33" |
Year | The year component of the date/time | Integer | $Utils.GetDateTime("31/12/2000 23:55:33.222").Year$ | 2000 |