[sys:date format="d.m.Y H:i:s" t="%timestamp%"]
The date block outputs a formatted time.
With the parameter, the format is defined. If no value is set or left empty, the value "Y-m-d H:i:s" is assumed.
Tip: To output a letter or d, each letter must be marked with the escape character \. For example: "\d\a\y: d" outputs "day: 01".
| Format Character | Description | Example Return Values |
|---|---|---|
| Day | ||
| d | Day of the month, 2 digits with leading zero | 01 to 31 |
| D | Weekday, abbreviated to three letters | Mon to Sun |
| j | Day of the month without leading zeros | 1 to 31 |
| l (small 'L') | Full weekday name | Sunday to Saturday |
| N | Numeric representation of the weekday according to ISO-8601 | 1 (for Monday) to 7 (for Sunday) |
| S | English ordinal suffix for a month day, two characters | st, nd, rd or th. Recommended for use with j. |
| w | Numeric day of the week | 0 (for Sunday) to 6 (for Saturday) |
| z | The day of the year (starting from 0) | 0 to 365 |
| Week | ||
| W | ISO-8601 week number of the year, the week starts on Monday | Example: 42 (the 42nd week in the year) |
| Month | ||
| F | td>Month as a full word, such as January or MarchJanuary to December | |
| m | Month as a number with leading zeros | 01 to 12 |
| M | Three-letter month name | Jan to Dec |
| n | Month number without leading zeros | 1 to 12 |
| t | Number of days in the specified month | 28 to 31 |
| Year | ||
| L | Leap year or not | 1 for a leap year, otherwise 0 |
| o | ISO-8601 calendar year number of the week. This results in the same value as Y, except when the ISO week (W) belongs to the previous or next year, in which case that year is used. | Examples: 1999 or 2003 |
| Y | Four-digit year number | Examples: 1999 or 2003 |
| y | Two-digit year number | Examples: 99 or 03 |
| Time | ||
| a | Lowercase: Ante meridiem (AM) and Post meridiem (PM) | am or pm |
| A | Uppercase: Ante meridiem (AM) and Post meridiem (PM) | AM or PM |
| B | Swatch Internet Time | 000 to 999 |
| g | Hour in 12-hour format without leading zeros | 1 to 12 |
| G | Hour in 24-hour format without leading zeros | 0 to 23 |
| h | Hour in 12-hour format with leading zeros | 01 to 12 |
| H | Hour in 24-hour format with leading zeros | 00 to 23 |
| i | Minutes, with leading zeros | 00 to 59 |
| s | Seconds, with leading zeros | 00 to 59 |
| u | Microseconds. Always outputs 000000. | Example: 000000 |
| Timezone | ||
| e | Time zone identifier | Examples: UTC, GMT, Atlantic/Azores |
| I (large 'i') | Whether a date falls in daylight saving time | 1 if daylight saving time, otherwise 0. |
| O | Difference to Greenwich Mean Time (GMT) in hours | Example: +0200 |
| P | Difference to Greenwich Mean Time (GMT) in hours with a colon between hours and minutes | Example: +02:00 |
| T | Time zone abbreviation | Examples: EST, MDT... |
| Z | Time zone offset in seconds. The offset for time zones west of UTC is always negative and for time zones east of UTC always positive. | -43200 to 50400 |
| z | Returns the day of the year without leading zero | |
| Full Date/Time | ||
| c | ISO 8601 date | 2004-02-12T15:19:21+00:00 |
| r | Date formatted according to » RFC 2822 | Example: Thu, 21 Dec 2000 16:01:07 +0200 |
| U | Seconds since the beginning of the UNIX epoch (January 1, 1970 00:00:00 GMT) | See also Function Block TIME |
The parameter declares the time in DT# in milliseconds. If no parameter is defined, the current time is used.