Date and time formatting

Settings for formatting the date and time.

Some controls can display date and time values or receive date and time values. A process variable of the VT_DATE data type (for DateTimeVarIn and DateTimeVarOut controls) or the system time (for Clock control) is used as the source. The date and time are automatically displayed in the format valid for the language of the app or browser.

Language-independent settings, such as the positioning of the date and time display, can be defined for a control via the properties of the "DateTimeFormat" category.

DateTimeMode

Determines whether only the time, only the date or both are displayed and how these elements are positioned within the control.

FormatDate

Defines the date format (see also Automatic switching of date and time formats depending on the language settingbelow).

FormatTime

Defines the time format (see also Automatic switching of date and time formats depending on the language settingbelow).

Automatic switching of date and time formats depending on the language setting

Different languages and regions have different rules for specifying the date and time, generally referred to as date and time formats.

Example: The same calendar day is given as "06 February 2023" in Germany and as "February 06, 2023" in the USA.

At runtime, this language-dependent date and time format for the output control elements "DateTimeVarOut" and "Clock" is determined by the language setting of the app. Initially, the language is set by the value of "RuntimeLanguage" in the appsettings.services.json file. The file can be found under [Client directory]Wappsettings. The default setting for the runtime language is German (de-DE).

{

"AppServices": {

"LanguageService": {

"DesigntimeLanguage": "de-DE",

"RuntimeLanguage": "de-DE",

"Locales": [

Excerpt from "appsettings.services.json"

The user can select a different language in the running app. The application frame, for example, contains a "Settings" page on which the preferred language (German or English) can be selected. By changing the app language, the format in all control elements of the type "Clock" and "DateTimeVarOut" is automatically changed to the format used in the respective language.

With the "DateTimeVarIn" input control element, however, the language-dependent format does not depend on the language setting of the app, but on the language setting of the browser.

You can access Chrome's language settings by clicking on the three horizontal dots at the top right of the browser window and selecting the "Settings" menu item. On the Settings page that now appears, select the "Languages" item and specify the desired language under "Preferred languages".

Affects these controls:

Clock, DateTimeVarIn, DateTimeVarOut