Technical data

Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
598 Manual, 05/2010, A5E02789666-01
27.3.3.2 Format of the Data Type DATE_AND_TIME
When you enter date and time using the DATE_AND_TIME data type (DT), your entries are stored
in binary coded decimal format in 8 bytes. The DATE_AND_TIME data type has the following
range:
DT#1990-1-1-0:0:0.0 to DT#2089-12-31-23:59:59.999
The following examples show the syntax for the date and time for Thursday, December 25, 1993,
at 8:12 and 34,567 seconds in the morning. The following two formats are possible:
DATE_AND_TIME#1993-12-25-8:12:34.567
DT#1993-12-25-8:12:34.567
The following special IEC (International Electrotechnical Commission) standard functions are
available for working with the DATE_AND_TIME data type:
Convert date and time of day to the DATE_AND_TIME format
FC3: D_TOD_DT
Extract the date from the DATE_AND_TIME format
FC6: DT_DATE
Extract the day of the week from the DATE_AND_TIME format
FC7: DT_DAY
Extract the time of day from the DATE_AND_TIME format
FC8: DT_TOD
The following table shows the contents of the bytes that contain the date and time information for
the example Thursday, December 25, 1993, at 8:12 and 34,567 seconds in the morning.
Byte Contents Example
0 Year B#16#93
1 Month B#16#12
2 Day B#16#25
3 Hour B#16#08
4 Minute B#16#12
5 Second B#16#34
6 Two most significant digits of MSEC B#16#56
7
(4MSB)
Two least significant digits of MSEC
B#16#7
7
(4LSB)
Day of week
1 = Sunday
2 = Monday
...
7 = Saturday
B#16#_5