Date and time formatting in BW (OP)

Hinweis

BW is only supported in LN 10.3 and earlier versions.

In BW, formatting of date and time fields is based on the Windows date and time settings and the LN format codes that are linked to the fields. Format codes refer to formats that are defined in the Date Formats (ttadv4580m000) and Time Formats (ttadv4586m000) sessions. A format determines, for example, whether a date field shows the year with or without the century, or whether a time field shows only hours and minutes and no seconds.

Date formatting

This section describes how the Windows settings and the LN date formats are combined and used to format date fields in BW.

The properties of the field format are retrieved and verified. If the format is defined to use week numbers and no day number is defined, this format is incompatible with the Windows Date control. This table shows how the format’s properties are changed in that scenario:

PropertyValue
Day NumberIn Month
Day NameNone
Month NumberNumber
Month NameAbbreviated
Year NumberWith Century

 

Hinweis

If the ERP format specifies that the Day Name or the Month Name must be displayed, the Windows long format is used; otherwise, the Windows short format is used.

This Windows format is then combined with the ERP format. The Windows format determines the order of the individual parts. The ERP format determines how the individual parts are formatted.

This table shows the rules that are applied:

Format d or dd

Day number of the month

This format is used if the ERP format uses a day number; otherwise, this format is skipped. This format is mapped to the day number of the month, regardless of whether the ERP format uses the day number of the week or the day number of the year. If the Zero Fill check box in the Date Formats (ttadv4180s000) session is selected, Windows format dd is used; otherwise format d is used.
Format ddd or dddd

Day name of the week

This format is used, regardless of whether the ERP format does not use day numbers. If the ERP format uses complete day names, Windows format dddd is used. If the ERP format uses abbreviated names, ddd is used. If the ERP format does not specify which format to use, the current Windows format is used.
Format M or MM

Month numbers

This format is used if the ERP format uses a month number; otherwise, this format is skipped. If the Zero Fill check box in the Date Formats (ttadv4180s000) session is selected, Windows format MM is used; otherwise format M is used.
Format MMM or MMMM

Month names

This format is used if the ERP format uses a month name or a month number. If the ERP format uses complete month names, Windows format MMMM is used. If the ERP format uses abbreviated names, MMM is used. If the ERP format does not specify which format to use, the current Windows format is used.
Format yy or yyyy

Year numbers

This format is used, regardless of whether the ERP format does not use the year number. If the ERP format uses years with the century, Windows format yyyy is used. If the century is not required, the Zero Fill check box determines whether format yy or y is used.

Note: When the cursor is in a date field, the year is displayed with the century.

Any literal text between single quotesThe specified text is used.
Any characterThis is treated as a date separator. The first time a character such as the period (.) is found in a date, that character is used as the date separator. If different characters are used as date separators, this character is used in place of the other characters. For example, Windows format dd.MM-yyyy becomes dd.MM.yyyy.

 

Beispiel 1

This table shows the Windows date formats for a Dutch user:

Short Dated-M-yyyy

For example, 9-1-2012

Long Datedddd d MMMM yyyy

For example, ‎maandag ‎9 ‎januari ‎2012

 

A date field uses ERP format 001. This table shows the properties for this format:

Day NameNone
Day NumberIn Month
Week NumberNone
Month NameNone
Month NumberNumber
Year NumberWithout century
Zero FillYes

 

Because no Day Name or Month Name is defined, the date is formatted based on the Windows Short Date format. The date value is formatted as dd-MM-yy, for example, 09-01-12.

Beispiel 2

This table shows the Windows date formats for a user in the United States:

Short DateM/d/yy

For example, 1/9/12

Long Datedddd, MMMM dd yyyy

For example, Monday, January 09, ‎2012

 

A date field uses ERP format 002. This table shows the properties for this format:

Day NameNone
Day NumberIn Month
Week NumberNone
Month NameNone
Month NumberNumber
Year NumberWith century
Zero FillYes

 

Because no Day Name or Month Name is defined, the date is formatted based on the Windows Short Date format.

The date value is formatted as: MM/dd/yyyy, for example, 01/09/2012.

Beispiel 3

This table shows the Windows date formats for a user in the United States (same as in example 2):

Short DateM/d/yy

For example, 1/9/12

Long Datedddd, MMMM dd yyyy

For example, Monday, January 09, ‎2012

 

A date field uses ERP format 003. This table shows the properties for this format:

Day NameNone
Day NumberIn Month
Week NumberNone
Month NameAbbreviated
Month NumberNone
Year NumberWith century
Zero FillNo

 

Because the abbreviated Month Name must be used, the date is formatted based on the Windows Long Date format. The date value is formatted as: dddd, MMM d yyyy, for example, Monday, Jan 9 2012.

Beispiel 4

This table shows the Windows date formats for a German user:

Short Datedd.MM.yyyy

For example, ‎09.‎01.‎2012

Long Datedddd, d. MMMM yyyy

For example, ‎Montag, ‎9. ‎Januar ‎2012

 

A date field uses ERP format 008. This table shows the properties for this format:

Day NameComplete
Day NumberIn month
Week NumberNone
Month NameComplete
Month NumberNone
Year NumberWith century
Zero FillYes

 

Because the complete Day Name and Month Name must be used, the date is formatted based on the Windows Long Date format. The date value is formatted as dddd, dd. MMMM yyyy, for example, Montag, 09. Januar 2012.

Time formatting

This section describes how the Windows settings and the LN time formats are used to format time fields in BW.

The data of the field format is retrieved and combined with the Windows time format. The Windows format determines the order of the individual parts; the ERP format determines how the individual parts are formatted.

Hinweis

In all scenarios, the Windows long time format is used.

This table shows the rules that are applied:

Format h or hh

12 hour notation

This is mapped to the Windows hh format.
Format H or HH

24 hour notation

This is mapped to the Windows HH format.
Format m or mm

Minutes

If the ERP format uses minutes, this is mapped to the Windows mm format.
Format s or ss

Seconds

If the ERP format uses seconds, this is mapped to the Windows ss format.
Format tt

AM or PM symbol

This is taken over.
Any characterThe first time a character such as the colon (:) is found in a time value, that character is used as the time separator.

 

Beispiel 1

A user has this Windows long time format: H:mm:ss

A time field uses ERP format 003. This table shows the properties for this format:

Hour Format12 Hour Format
MinutesNo
SecondsNo

 

The time value is formatted as HH, for example, 16, which is four o’clock in the afternoon.

Beispiel 2

A user has this Windows long time format: H:mm:ss

A time field uses ERP format 099. This table shows the properties for this format:

Hour Format12 Hour Format
MinutesYes
SecondsNo

 

The time value is formatted as: HH:mm, for example, 16:24.

Beispiel 3

A user has this Windows long time format: h:mm:ss tt

A Time field uses ERP format 001. This table shows the properties for this format:

Hour Format24 Hour Format
MinutesYes
SecondsYes

 

The time value is formatted as hh:mm:ss tt, for example, 04:24:37 PM.