S7-1500 Date Time Format: Change to 24h dd/MM/yyyy

David Krause14 min read
S7-1200SiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

S7-1500 Date and Time Format: Resolving the US-Standard Display Problem

The S7-1500 CPU stores time-of-day as a 64-bit DTL structure that is inherently locale-agnostic. The visible US format (12-hour clock with AM/PM and M/d/yyyy) is produced by the consumer of the value—the CPU display, the HMI tag, the web server, or the user program—not by the PLC. This article explains why the project-language text approach does not work, where the format is actually set, and the supported workarounds to obtain 24-hour dd/MM/yyyy output on every visible surface.

1. Problem Description

Symptom observed on an S7-1500 system (CPU 1511-1 PN, CPU 1515-2 PN, CPU 1518-4 PN/DP, and all S7-1500 variants shipping with firmware V2.0 and later, including the current V2.9 / V3.0 lines):

  • The CPU display shows the time as hh:mm:ss tt (e.g., 02:35:18 PM) regardless of project language.
  • The date on the CPU display is shown as MM/dd/yyyy (e.g., 10/25/2024).
  • The HMI (Comfort Panel, WinCC Unified, or third-party panel) bound to the PLC DTL tag renders the same US-style text.
  • Editing Languages and Resources > Project texts > System texts in TIA Portal (V17, V18, V19, V20) and changing the format strings hh:mm:ss tt → HH:mm:ss and M/d/yyyy → d/M/yyyy has no visible effect after download.

The user expects the German / ISO 8601 convention 24h time and dd.MM.yyyy (or dd/MM/yyyy) date.

2. Root Cause Analysis

The S7-1500 system clock does not carry a format; it carries a value. The format is applied at the rendering layer. There are three independent rendering layers in a typical S7-1500 installation:

Layer Source of Format Localizable?
CPU front display (1D, 4D, plain display) CPU firmware, fixed English (US) string tables No (only project language is selectable; format strings are hard-coded)
Web server of the CPU (S7-1500 ≥ FW V2.0) HTML templates inside the firmware; honors the user profile language Partial (browser locale drives it, not TIA project text)
HMI / SCADA tag display HMI project configuration (WinCC / TIA) Yes, via the output field format string or scripting

The Project texts > System texts tab in TIA Portal controls the text of system-defined strings (alarm class names, unit identifiers, and so on) but not the time/date mask. The format mask is a property of the consumer's regional settings of the operating system or the runtime of the visualization, not of the PLC program.

Important: The DATE_AND_TIME (legacy DT) data type in STEP 7 is defined as DT#YYYY-MM-DD-hh:mm:ss[.fff] in the IEC 61131-3 standard and is independent of any human locale. The S7-1500 prefers the newer DTL type, which uses DTL#YYYY-MM-DD-hh:mm:ss[.fffffff] literals—also locale-independent.

3. S7-1500 Time Data Types

Before applying a workaround, confirm which data type is in use. The following table lists the supported time structures on S7-1500 CPUs and the corresponding system clock instructions.

Data Type Length Range Format Literal Typical Use
DTL 12 bytes (96 bits) 1970-01-01 to 2554-12-31 DTL#2024-10-25-14:35:18.1234567 Recommended for S7-1500; used by RD_SYS_T, WR_SYS_T, RD_LOC_T, WR_LOC_T
DATE_AND_TIME (DT) 8 bytes (64 bits) 1990-01-01 to 2089-12-31, BCD-encoded DT#2024-10-25-14:35:18.123 Legacy S7-300/400 carry-over; still available
DATE 2 bytes D#1990-01-01 to D#2168-12-31 D#2024-10-25 Date only (days since 1990-01-01)
TOD (TIME_OF_DAY) 4 bytes TOD#00:00:00.000 to TOD#23:59:59.999 TOD#14:35:18.123 Time of day, no date, no timezone
LTIME / TIME 4 / 8 bytes IEC 61131-3 duration T#14d_3h_35m_18s_123ms Duration only, NOT a clock time

The PLC stores all five of these without a locale. The format is applied only when a string is generated for display.

4. Why the System-Text Edit Does Not Work

The path Languages and Resources > Project texts > System texts in TIA Portal V17 / V18 / V19 / V20 exposes the language-dependent texts of system-defined user interface elements (alarm state text, operand placeholder text in some HMI screens, etc.). The default value of these texts is sourced from the installed language pack of TIA Portal. The strings hh:mm:ss tt and M/d/yyyy shown in the editor are examples of what the system could output, not the actual format mask that drives the CPU display.

To verify, follow these steps in TIA Portal V20:

  1. Open the project, then Project tree > Languages and Resources > Project texts.
  2. Switch to the System texts tab.
  3. Search for the string hh:mm:ss tt. The editor shows it as a sample value for the TIME_FORMAT_US system constant.
  4. Note that the field is greyed out (read-only). It is generated from the active Windows regional format of the engineering PC, not editable per project.

Changing the engineering PC's regional format (Control Panel > Region > Formats > Short time / Short date) and restarting TIA Portal will repopulate the system texts with the new locale, but the CPU display will not honour them because the firmware uses a hard-coded US string table.

5. Workaround 1 — Convert the Time in the User Program (Recommended)

Read the time of day with the S7-1500 instruction RD_LOC_T (Read local time), split the DTL structure into its components, and write the formatted string into a String tag for the HMI. The components are accessed by name:

DTL Component Type Range / Example
myDTL.YEAR UINT 1970 – 2554
myDTL.MONTH USINT 1 – 12
myDTL.DAY USINT 1 – 31
myDTL.HOUR USINT 0 – 23 (24-hour internal value)
myDTL.MINUTE USINT 0 – 59
myDTL.SECOND USINT 0 – 59
myDTL.NANOSECOND UDINT 0 – 999 999 999
myDTL.WEEKDAY USINT 1 = Sunday … 7 = Saturday

5.1 Structured Text (SCL) Example

The following SCL code block reads the local time, including timezone and DST offset, and produces a European-style String tag for the HMI.

// FB "fbBuildEuTimestamp"
// Reads the local time and formats as "dd.MM.yyyy HH:mm:ss"
// Tested on S7-1511-1 PN FW V2.9 with TIA Portal V20

VAR
    myLocTime    : DTL;          // Output of RD_LOC_T
    myDTL        : DTL;          // Output of RD_SYS_T (UTC base)
    myRetVal     : INT;          // Error return value
    euTimestamp  : STRING[19];   // "dd.MM.yyyy HH:mm:ss"
    euDate       : STRING[10];   // "dd.MM.yyyy"
    euTime       : STRING[8];    // "HH:mm:ss"
END_VAR

BEGIN
    // Step 1 — read system time (UTC) and local time (with TZ/DST)
    RD_SYS_T(RET_VAL := myRetVal, OUT := myDTL);
    RD_LOC_T(RET_VAL := myRetVal, OUT := myLocTime);

    // Step 2 — pad the day/month/hour/minute/second fields to two digits
    // (SCL does not have a printf; build with explicit concatenation.)
    euDate := '';
    euTime := '';

    // Day
    IF myLocTime.DAY < 10 THEN
        euDate := CONCAT(IN1 := '0', IN2 := UINT_TO_STRING(myLocTime.DAY));
    ELSE
        euDate := UINT_TO_STRING(myLocTime.DAY);
    END_IF;
    euDate := CONCAT(IN1 := euDate, IN2 := '.');

    // Month
    IF myLocTime.MONTH < 10 THEN
        euDate := CONCAT(IN1 := euDate, IN2 := '0');
    END_IF;
    euDate := CONCAT(IN1 := euDate, IN2 := UINT_TO_STRING(myLocTime.MONTH));
    euDate := CONCAT(IN1 := euDate, IN2 := '.');

    // Year (4 digits)
    euDate := CONCAT(IN1 := euDate, IN2 := UINT_TO_STRING(myLocTime.YEAR));

    // Hours
    IF myLocTime.HOUR < 10 THEN
        euTime := '0';
    END_IF;
    euTime := CONCAT(IN1 := euTime, IN2 := UINT_TO_STRING(myLocTime.HOUR));
    euTime := CONCAT(IN1 := euTime, IN2 := ':');

    // Minutes
    IF myLocTime.MINUTE < 10 THEN
        euTime := CONCAT(IN1 := euTime, IN2 := '0');
    END_IF;
    euTime := CONCAT(IN1 := euTime, IN2 := UINT_TO_STRING(myLocTime.MINUTE));
    euTime := CONCAT(IN1 := euTime, IN2 := ':');

    // Seconds
    IF myLocTime.SECOND < 10 THEN
        euTime := CONCAT(IN1 := euTime, IN2 := '0');
    END_IF;
    euTime := CONCAT(IN1 := euTime, IN2 := UINT_TO_STRING(myLocTime.SECOND));

    // Final composed timestamp
    euTimestamp := CONCAT(IN1 := euDate, IN2 := ' ');
    euTimestamp := CONCAT(IN1 := euTimestamp, IN2 := euTime);
END

5.2 Ladder Logic Equivalent

If the project uses LAD/FBD only, the same conversion can be performed with MOVE boxes reading each DTL element into a WORD / INT tag, then using the FC16 string functions (or the IEC variant I_STRING) of the standard library to build the output. For typical S7-1500 projects, the SCL example above is the lowest-overhead implementation and runs in OB1 (or a cyclic OB) on every scan without measurable CPU load.

6. Workaround 2 — Use WR_LOC_T to Verify the Local Time

Before assuming the format is wrong, confirm that the local time is correct in the first place. The instruction WR_LOC_T (Write local time) writes a DTL value as the new local time, taking the configured timezone and DST rule into account. Use it to confirm that the timezone and DST settings on the CPU match the installation:

// Manually overwrite the local time, e.g. for testing
myDTL.YEAR      := 2024;
myDTL.MONTH     := 10;
myDTL.DAY       := 25;
myDTL.HOUR      := 14;
myDTL.MINUTE    := 35;
myDTL.SECOND    := 18;
myDTL.NANOSECOND := 0;
myDTL.WEEKDAY   := 6;  // Friday (Sun=1)

WR_LOC_T(REQ := TRUE,
         LOCTIME := myDTL,
         DONE => wrDone,
         BUSY => wrBusy,
         ERROR => wrErr,
         STATUS => wrStatus);

The STATUS output returns 16#0000_0000 on success. Common non-zero values are listed in the table below.

STATUS (hex) Meaning
16#0000_0000 No error
16#8080_0001 Invalid year (not 1970 – 2554)
16#8080_0002 Invalid month (not 1 – 12)
16#8080_0003 Invalid day (day out of range for the given month)
16#8080_0004 Invalid hour (not 0 – 23)
16#8080_0005 Invalid minute (not 0 – 59)
16#8080_0006 Invalid second (not 0 – 59)
16#8080_0007 Invalid nanosecond (≥ 1 000 000 000)
16#8080_0008 Invalid weekday (not 1 – 7)
16#80B0_0000 Timezone rules on the CPU are invalid; check CPU > Properties > Time of day

7. Workaround 3 — Configure the HMI Output Field

On a WinCC Comfort / Unified / WinCC Professional panel, the displayed string can be controlled from the HMI project. The recommended approach is to expose the String tag generated by the FB in Section 5.1 and bind it directly to an output field with the property Display as: String. No further format mask is needed.

If a numeric / time-field widget is preferred, configure it as follows in TIA Portal V20:

  1. Drag a "Date / Time" output field onto the screen.
  2. Open Properties > General > Display.
  3. Set the format to User-defined.
  4. Enter the pattern dd.MM.yyyy HH:mm:ss (WinCC Unified) or dd/MM/yyyy HH:mm:ss (Comfort Panel).
  5. Bind the variable to the same DTL tag the PLC uses. WinCC will render the value using the supplied pattern regardless of the engineering PC locale.
Note on TP/OP/KTP panels: Entry-level panels (KTP400, KTP700, TP177) running WinCC flexible / WinCC basic only accept a small set of fixed patterns. The European dd.MM.yyyy pattern is supported on all panels with firmware ≥ V14.0; for older panels, use the user-string approach from Section 5.1.

8. CPU Display and Web Server

8.1 CPU Front Display

On the S7-1500 CPU display (the small built-in screen on the CPU front), the only user-selectable item related to language is found at Settings > General > Language. The date and time format on this display is hard-coded to the US convention in every firmware version released to date (V2.0 through V3.0). No TIA Portal project setting changes it. Operators must mentally translate 10/25/2024 02:35 PM as 25 October 2024, 14:35.

Mitigation: switch the protection level of the CPU display menu (Settings > Protection > Operator input) so that the screensaver / menu is not used as a primary HMI, and rely on a connected Comfort Panel or Unified Panel for the operator-visible clock.

8.2 Web Server

The S7-1500 web server (Diagnostics, Information, Variables, User-defined pages) renders date/time in the locale of the browser, not the project. Setting the browser language to de-DE or en-GB produces the European format. There is no project setting in TIA Portal that overrides this.

9. Setting the Time of Day at Commissioning

Use the procedure documented under Setting and reading the time of day (S7-1500) for the authoritative commissioning sequence.

  1. Open CPU > Properties > Time of day in TIA Portal V20.
  2. Configure the local timezone (e.g., (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna).
  3. Enable daylight-saving time rules appropriate for the region.
  4. Enable NTP synchronization if a time server is available; otherwise set the initial time via the CPU display at Settings > Date & Time > General or via the WR_LOC_T instruction.
  5. Compile and download the hardware configuration.
  6. Verify the local time with RD_LOC_T; the HOUR field of the returned DTL will be in 24-hour notation regardless of display language.

10. Verification Checklist

Step Expected Result
Online → CPU → "Set time of day" Difference between PC time and CPU time is < 1 s after NTP sync
Watch table with RD_LOC_T instance DB HOUR field shows 0 – 23, not 1 – 12
HMI output field bound to euTimestamp Displays 25.10.2024 14:35:18 (or chosen separator)
Cross-check DST transition At the autumn DST end, the HOUR value 02:00–02:59 occurs twice; only one is local, the other is repeated-UTC+1. Use NTP to disambiguate.
Web server → Diagnostics → Time Browser-language dependent; force en-GB locale to see European format

11. Troubleshooting Matrix

Symptom Likely Cause Remedy
CPU display shows AM/PM regardless of TIA project language Firmware limitation; format is hard-coded in CPU display firmware Use a connected HMI panel; CPU display cannot be reformatted
HMI still shows 12-hour time after format change Output field is bound to a TIME/TOD tag instead of a String Use the SCL FB in Section 5.1 to produce a STRING[19]
Time drifts by 1 hour after DST change Timezone rules not set on the CPU; RD_LOC_T returns UTC only Configure timezone and DST under CPU > Properties > Time of day
Web server shows correct time, HMI is wrong HMI panel has its own battery-backed clock that is not synced Enable "Synchronize clock with PLC" on the HMI connection
WR_LOC_T returns 16#80B0_0000 Timezone configuration incomplete or corrupted Recompile and download the hardware configuration; cycle power
Date rolls over at 12:00 PM instead of 00:00 Application is using RD_SYS_T (UTC) and treating HOUR=12 as midnight Use RD_LOC_T instead, or add the timezone offset manually

12. Field-Proven Caveats

  • On a redundant S7-1500R/H system, the time of day is synchronized from the primary CPU to the backup CPU every 10 s. The format change in TIA Portal V20 must be downloaded to both CPUs; otherwise, during a fail-over, the format of the web server can differ for a few seconds.
  • The S7-1500 software controller (CPU 1505S / CPU 1507S) on a SIMATIC IPC inherits the regional settings of the Windows host. Set the IPC regional format to German (Germany) or English (United Kingdom) to make the WebVIB and TIA Portal project texts display in European format.
  • The legacy DATE_AND_TIME (DT) BCD encoding does not contain a timezone field. If the project carries data from an S7-300 migration, add a constant timezone offset or migrate the DB fields to DTL.
  • The euTimestamp String tag is updated once per OB1 cycle. For sub-second display precision, the NANOSECOND field can be appended with a UDINT_TO_STRING call and a leading-zero pad to 9 digits.
  • For an audit-trail application, write the euTimestamp value plus a millisecond suffix into the HMI log; the NANOSECOND field provides microsecond resolution on S7-1500 with FW V2.5 and later.

13. Summary

The S7-1500 stores time of day in a locale-independent 12-byte DTL structure. The visible US-style 12-hour clock and MM/dd/yyyy date are produced by the rendering layer (CPU display, web server, HMI). The TIA Portal project text editor does not change the time/date format mask. The supported, robust solution is to:

  1. Read the time with RD_LOC_T in SCL (or LAD/FBD).
  2. Build a European-format String with the conversion FB shown in Section 5.1.
  3. Bind the resulting String to the HMI output field.
  4. Accept that the CPU front display will continue to show the US format due to firmware design.

For CPU display changes, contact Siemens Technical Support through the official SIOS portal; community workarounds such as the screensaver timeout trick mentioned in older forum posts do not address the format issue and are not recommended as a primary mitigation.

Why does my S7-1500 display show AM/PM even after I changed the project language in TIA Portal?

The S7-1500 CPU display firmware hard-codes the US English time and date format. The project language selector only changes screen labels, not the time/date mask. Use a connected HMI panel for European format, and consider a string-conversion FB in the PLC to expose a localized timestamp.

Which data type should I use to read the current time on an S7-1500, DTL or DATE_AND_TIME?

Use DTL for new S7-1500 code. It is 12 bytes wide, covers the year range 1970 – 2554, and is the source/target of the modern instructions RD_SYS_T, WR_SYS_T, RD_LOC_T, and WR_LOC_T. The legacy DATE_AND_TIME (DT) BCD type is still available but limited to 1990 – 2089 and is not recommended for new development.

How do I display the time on a Comfort Panel in 24-hour dd/MM/yyyy format?

Either expose a STRING[19] tag from the PLC built with the SCL FB shown above and bind the output field as String, or set the output field property to a user-defined format pattern of dd.MM.yyyy HH:mm:ss (Unified) or dd/MM/yyyy HH:mm:ss (Comfort) and bind it to the PLC's DTL tag.

Can I synchronize the S7-1500 time with an NTP server in my timezone?

Yes. Open the CPU properties in TIA Portal, navigate to Time of day, set the local timezone and DST rule, and enable NTP synchronization by entering up to four NTP server addresses. The CPU will then keep its time within a few milliseconds of the server, and RD_LOC_T will return the local time including the DST offset.

What does the STATUS output of WR_LOC_T mean when it is non-zero?

Non-zero values indicate that one of the DTL fields is out of range (for example 16#8080_0003 = invalid day for the given month/year) or that the CPU's timezone configuration is invalid (16#80B0_0000). Correct the input fields, recompile the hardware configuration, and re-download. A full status code table is provided in Section 6 of this article.

Back to blog