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 ParametersDescriptionReturn TypeUsage Examples
DayThe day component of the date/timeInteger
$Utils.GetDateTime("31/12/2000 23:55:33.222").Day$31
DayOfWeekThe name of the day of week of the date/timeString
$Utils.GetDateTime("31/12/2000 23:55:33.222").DayOfWeek$"Sunday"
DaysAgoThe number of days which have passed since the date/timeInteger
$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 stringsString

$Utils.GetDateTime("31/12/2000 23:55:33.222").Hour: $Utils.GetDateTime("31/

"31 Dec 2000 11:55"
HourThe hour component of the date/timeInteger
$Utils.GetDateTime("31/12/2000 23:55:33.222").Hour$23
HoursAgoThe number of hours which have passed since the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").HoursAgo$156616
LocalThe date/time converted to local server timeDateTime$Utils.GetDateTime("31/12/2000 23:55:33.222").Local$"31/12/2000 23:55:33"
MillisecondThe millisecond component of the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").Millisecond$222
MinuteThe minute component of the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").Minute$55
MinutesAgoThe number of minutes which have passed since the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").MinutesAgo$9396972
MonthThe month component of the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").Month$12
SecondThe second component of the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").Second$33
SecondsAgoThe number of seconds which have passed since the date/timeInteger$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"
UTCThe 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"
YearThe year component of the date/timeInteger$Utils.GetDateTime("31/12/2000 23:55:33.222").Year$2000



  • No labels