Global:Server.Date
Version: - globalvalueSummary
Returns the date on the server.
Settings
The value is generated automatically.
Remarks
The following date/time tag extensions are available wherever indicated (HTML only):
Extension | Description |
*.Day | Returns the day of the month. (1-31) |
*.LongDayName | Returns the name of the day. (E.g. Monday) |
*.ShortDayName | Returns the short name of the day. (E.g. Mon) |
*.Hour | Returns the hour part of the time. (0-23) |
*.Minute | Returns the minute part of the time. (0-59) |
*.Second | Returns the second part of the time. (0-59) |
*.Month | Returns the month part of the date as numeric value. (1-12) |
*.LongMonthName | Returns the full name of the month. (E.g. March) |
*.ShortMonthName | Returns the short name (3 letters) of the month (E.g. Mar) |
*.Year | Returns the year part of the date. (E.g 2006) |
*.Weekday | Returns the numeric representation of the day of the week. (1-7) |
*.WeekOfYear | Returns the week number of the year. (1-53) |
*.DayOfYear | Returns the day number of the year. (1-366) |
*.Quarter | Returns the quarter number of the year. (1-4) |
*.GeneralDate | Returns the date in the general format. |
*.LongDate | Returns the date using the long date format. |
*.LongTime | Returns the time using the time format: hh:mm:ss PM/AM |
*.MediumDate | Returns the date using the medium date format. |
*.ShortDate | Returns the date using the short date format. |
*.ShortTime | Returns the time using the 24-hour format: hh:mm |
*.Sortable | Returns the date using a defined standard (ISO 8601). It is always the same, regardless of the culture used or the format provider supplied. The format string is yyyy-mm-ddThh:mm:ss (E.g. 2011-06-20T12:28:05). |
*.SortableOffset |
Returns the date using a defined standard (ISO 8601). It is always the same, regardless of the culture used or the format provider supplied - relative to UTC. The format string is yyyy-mm-ddThh:mm:ss+/-hh:mm (E.g. 2011-06-20T12:28:05+02:00). |
*.RFC1123 | Returns the date using the RFC1123 format. (E.g. Thu, 06 Apr 2006 09:30:00 GMT) |
Examples
Outputting the template tag
@GetGlobalValue("Global:Server.Date")
Check if tag has a value
@if(!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Server.Date"))) {
@* Tag has value, so let's do something useful here. *@
}
Assign tag to a value for later use
@{
string storedTag = GetGlobalValue("Global:Server.Date");
}
Outputting the template tag
<!--@Global:Server.Date-->
Check if globalvalue has a value
<!--@If Defined(@Global:Server.Date)-->
Let's output this tag here: <strong><!--@Global:Server.Date--></strong>
<!--@EndIf(@Global:Server.Date)-->