Date and time formatting in BW
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:
Property | Value |
---|---|
Day Number | In Month |
Day Name | None |
Month Number | Number |
Month Name | Abbreviated |
Year Number | With Century |
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. This is 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 quotes | The specified text is used. |
Any character | This 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. |
Example 1
This table shows the Windows date formats for a Dutch user:
Short Date |
d-M-yyyy For example, 9-1-2012 |
Long Date |
dddd 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 Name | None |
Day Number | In Month |
Week Number | None |
Month Name | None |
Month Number | Number |
Year Number | Without century |
Zero Fill | Yes |
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.
Example 2
This table shows the Windows date formats for a user in the United States:
Short Date |
M/d/yy For example, 1/9/12 |
Long Date |
dddd, 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 Name | None |
Day Number | In Month |
Week Number | None |
Month Name | None |
Month Number | Number |
Year Number | With century |
Zero Fill | Yes |
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.
Example 3
This table shows the Windows date formats for a user in the United States, the same as in example 2:
Short Date |
M/d/yy For example, 1/9/12 |
Long Date |
dddd, 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 Name | None |
Day Number | In Month |
Week Number | None |
Month Name | Abbreviated |
Month Number | None |
Year Number | With century |
Zero Fill | No |
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.
Example 4
This table shows the Windows date formats for a German user:
Short Date |
dd.MM.yyyy For example, 09.01.2012 |
Long Date |
dddd, 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 Name | Complete |
Day Number | In month |
Week Number | None |
Month Name | Complete |
Month Number | None |
Year Number | With century |
Zero Fill | Yes |
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.
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 character | The first time a character such as the colon (:) is found in a time value, that character is used as the time separator. |
Example 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 Format | 12 Hour Format |
Minutes | No |
Seconds | No |
The time value is formatted as HH, for example, 16, which is four o’clock in the afternoon.
Example 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 Format | 12 Hour Format |
Minutes | Yes |
Seconds | No |
The time value is formatted as: HH:mm, for example, 16:24.
Example 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 Format | 24 Hour Format |
Minutes | Yes |
Seconds | Yes |
The time value is formatted as hh:mm:ss tt, for example, 04:24:37 PM.