PLC concepts
5.4 Data types
S7-1200 Programmable controller
128 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 5- 32 Time and date data types
Time 32 bits T#-24d_20h_31m_23s_648ms to
T#24d_20h_31m_23s_647ms
Stored as: -2,147,483,648 ms to
+2,147,483,647 ms
T#5m_30s
T#1d_2h_15m_30s_45ms
TIME#10d20h30m20s630ms
500h10000ms
Date 16 bits D#1990-1-1 to D#2168-12-31 D#2009-12-31
DATE#2009-12-31
Time_of_Day
32 bits TOD#0:0:0.0 to TOD#23:59:59.999 TOD#10:20:30.400
TIME_OF_DAY#10:20:30.400
DTL
(Date and
Time Long)
12
bytes
Min.: DTL#1970-01-01-00:00:00.0
Max.: DTL#2262-04-11:23:47:16.854 775
DTL#2008-12-16-
20:30:20.250
TIME data is stored as a signed double integer interpreted as milliseconds. The editor format
can use information for day (d), hours (h), minutes (m), seconds (s) and milliseconds (ms).
It is not necessary to specify all units of time. For example T#5h10s and 500h are valid.
The combined value of all specified unit values cannot exceed the upper or lower limits in
milliseconds for the Time data type (-2,147,483,648 ms to +2,147,483,647 ms).
DATE data is stored as an unsigned integer value which is interpreted as the number of days
added to the base date 01/01/1990, to obtain the specified date. The editor format must
specify a year, month and day.
TOD (TIME_OF_DAY) data is stored as an unsigned double integer which is interpreted as
the number of milliseconds since midnight for the specified time of day (Midnight = 0 ms).
The hour (24hr/day), minute, and second must be specified. The fractional second
specification is optional.