You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

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.

NameDescriptionParametersReturn TypeUsage Examples
DayThe day component of the date/time
number

DayOfWeekThe name of the day of week of the date/time
string

DaysAgoThe number of days which have passed since the date/time
number

FormatFormats 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")
HourThe hour component of the date/time
number

HoursAgoThe number of hours which have passed since the date/time
number

LocalThe date/time converted to local server time
DateTime

MillisecondThe millisecond component of the date/time
number

MinuteThe minute component of the date/time
number

MinutesAgoThe number of minutes which have passed since the date/time
number

MonthThe month component of the date/time
number

SecondThe second component of the date/time
number

SecondsAgoThe number of seconds which have passed since the date/time
number

ToLongDateStringThe date/time represented in long date format. For the en-AU culture, the standard long date pattern is "dddd, d MMMM yyyy".
string

ToLongTimeStringThe date/time represented in long time format. For the en-AU culture, the standard long time pattern is "h:mm:ss tt".
string

ToShortDateStringThe date/time represented in short date format. For the en-AU culture, the standard short date pattern is "d/MM/yyyy"
string

ToShortTimeStringThe date/time represented in short time format. For the en-AU culture, the standard short time pattern is "h:mm tt"
string

UTCThe date/time converted to Coordinated Universal Time (UTC)
DateTime

YearThe year component of the date/time
number







  • No labels