Compatibility Notice
Compatibility Notice
In order to get the usual display, in V3.5 SP17 and higher, as a rule three digits
are used for the output of fractions of a second (ms/µs/ns). Example: In %t[dd-HH:mm:ss:ms], ms is specified with three digits for the milliseconds. A zero is prepended to the two-digit
ms number.If a two-digit output is desired (like before V3.5 SP17), then a special compiler
define has to be set in the compiler properties of the application: VISU_MILLISEC_NOLEADING_ZERO.
Recommended data types for date and time definitions: DATE, DATE_AND_TIME, DT, LDATE, LDATE_AND_TIME, LDT, LTOD, TIME_OF_DAY, TOD
By default, the names of the days and months are displayed in English. When localized
texts are used, the System text list has to be supplemented. This text list is automatically created in the
“POUs” view when the %t placeholder is used. The English terms have to be used as the IDs here. The localization
can be done for both the abbreviated names and full names.
The format string for a date and time definition has the following format:
%t[ <date and time unit> ]
|
Syntax |
Example |
Description |
Example in Visualization |
|---|---|---|---|
|
<date and time unit> |
Required Identification for date and time units Filters from the time value (data type: date and time) the value for the specified unit (year, month, day, hour, minute, milliseconds) For 64-bit date and time values, also microseconds and nanoseconds |
||
|
|
|
Year with century |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Year without century (00–99) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Year without century (0–99) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Month as full name |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Month as abbreviated name |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Month as number (01–12) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Month as number (1–12) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Day of week as number (1 = Monday – 7 = Sunday) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Day of week as full name |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Day of week as abbreviated name |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Day of month as number (01–31) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Day of month as number (1–31) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Day of year as number (001–366) |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Hour in 24-hour format (00–23) Example
|
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Hour in 12-hour format (01–12) Example
|
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Abbreviation A or P in 12-hour format A for P for Example
|
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Abbreviation AM or PM in 12-hour format AM for PM for Example
|
Code: “Text” property: “Text variable” property: Output: |
Inside the brackets, identifications for date and time units can occur any number of times and can be interchanged with any strings.
|
Syntax |
Example |
Description |
Example in Visualization |
|---|---|---|---|
|
|
Date and day of the week with separators in between |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
Time of day |
Code: “Text” property: “Text variable” property: Output: |
|
|
|
If strings should be output which correspond to a format definition, then these have to be represented in single straight quotation marks. |
“Text” property: Output: |