<< Click to Display Table of Contents > 

SAMLight Manual > Entities (Objects) > Date Time > Date Time Format

Date Time Format
Previous pageReturn to chapter overviewNext page

Press the Edit Format... button in the DateTime Property page to show this dialog.

date_time_advanced

Figure 256: Date Time Advanced Dialog

Code: Enter an encoded format definition for date time. The standard formats are not editable.

Convert: Pressing the arrow button converts the format definition given in Code and extends the date time format list.

Format: List of defined date time formats.

New: Creates an empty format. It is editable in the Code field.

Delete: Deletes current format from format list. The standard formats are not deletable.

Cancel: Leaves DateTime Advanced without taking changes.

OK: Changed list is valid. It will be shown in the DateTime property page also after a new start of the program.

Format definitions:

Format

Description

%1d

Day of the month as digits without leading zeros for single-digit days.

%2d

Day of the month as digits with leading zeros for single-digit days.

%3d

Abbreviated day of the week as specified by a LOCALE_SABBREVDAYNAME* value, for example, "Mon" in English (United States). Windows Vista and later: If a short version of the day of the week is required, your application should use the LOCALE_SSHORTESTDAYNAME* constants.

%4d

Day of the week as specified by a LOCALE_SDAYNAME* value.

%1M

Month as digits without leading zeros for single-digit months.

%2M

Month as digits with leading zeros for single-digit months.

%3M

Abbreviated month as specified by a LOCALE_SABBREVMONTHNAME* value, for example, "Nov" in English (United States).

%4M

Month as specified by a LOCALE_SMONTHNAME* value, for example, "November" for English (United States), and "Noviembre" for Spanish (Spain).

%1y

Year represented only by the last digit.

%2y

Year represented only by the last two digits. A leading zero is added for single-digit years.

%4y

Year represented by a full four or five digits, depending on the calendar used. Thai Buddhist and Korean calendars have five-digit years. The %4y pattern shows five digits for these two calendars, and four digits for all other supported calendars. Calendars that have single-digit or two-digit years, such as for the Japanese Emperor era, are represented differently. A single-digit year is represented with a leading zero, for example, "03". A two-digit year is represented with two digits, for example, "13". No additional leading zeros are displayed.

%1g

%2g

Period/era string formatted as specified by the CAL_SERASTRING value. The %1g and %2g format pictures in a date string are ignored if there is no associated era or period string.

%a

Abbreviated weekday name [a]

%A

Full weekday name [a]

%b

Abbreviated month name [a]

%B

Full month name [a]

%c

Date and time representation appropriate for locale [a]

%C

Month as character digit (A-L)

%d

Day of month as decimal number (01 – 31)

%H

Hour in 24-hour format (00 – 23)

%I

Hour in 12-hour format (01 – 12)

%j

Day of year as decimal number (001 – 366)

%k

Weekday as decimal number (1 - 7; Sunday is 7)

%K

Weekday as decimal number (1 - 7; Sunday is 1)

%L
%2L

%3L

%4L

Month mapping Placeholder, see Months Map.
There are 4 month maps available. To address the first, use %L, to address the second use %2L, to address the third and forth use %3L and %4L, respectively.

%l

%2l

%3l

%4l

Day mapping Placeholder, see Day Map.

There are 4 day maps available. To address the first, use %l, to address the second use %2l, to address the third and forth use %3l and %4l, respectively.

%m

Month as decimal number (01 – 12)

%M

Minute as decimal number (00 – 59)

%o

%2o

%3o

%4o

Year mapping placeholder, see Year Map.

There are 4 year maps available. To address the first, use %o, to address the second use %2o, to address the third and forth use %3o and %4o, respectively.

%O

Year as a single character representation, ASCII character 'H' represents Year 2000.
After 'Z', the next year starts with the character 'A' again (starting with SAMLight Version 3_8_5_006_20190117).

%p

Current locale's A.M./P.M. indicator for 12-hour clock [a]

%q

Week of year as decimal number, with Monday as first day of week (01 – 53) (also %W)

%Q

Week of year as decimal number, with Sunday as first day of week (01 – 53) (also %U)

%r, %R

Year as a single decimal number representation ( 0 - 9; Eg. year 2008 is 8 )

%s

Second of the day with leading zeros (00000 – 86399)

%S

Second as decimal number (00 – 59)

%T

%2T

%3T

%4T

Working Shift Placeholder, see chapter Shift Map.
There are 4 shift maps available. To address the first, use %T, to address the second use %2T, to address the third and forth use %3T and %4T, respectively.

%v

Hour to letter representation ( 'A' - 'Z'; 0:00 h is 'A' )´

%w

Weekday as decimal number (0 – 6; Sunday is 0)

 

 

%x

Date representation for current locale [a]

%X

Time representation for current locale [a]

%*

Year without century, as decimal number (00 – 99) and corresponding week of year as decimal number

%y

Year without century, as decimal number (00 – 99)

%Y

Year with century, as decimal number

%z, %Z  

Time zone name or abbreviation; no characters if time zone is unknown

%%

Percent sign

Table 34: Format definitions for Date Time objects

[a]: If If no language is selected in the drop down list "Language" of the Date Time property page, the language of the Windows system is taken. For specifier which do not use any Windows language, this drop down menu is not available.

Format

Description

%#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#%

# flag is ignored.

%#c

Long date and time representation, appropriate for current locale. For example: "Tuesday, March 14, 1995, 12:41:29".

%#x

Long date representation, appropriate for current locale.

For example: "Tuesday, March 14, 1995".

%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y

Remove leading zeros (if any).

Table 35: Special format definitions for Date Time objects

PersianDateTime

Figure 257: Example of Persian DateTime object

The Persian date 1394/07/19 is created with identifiers %4y/%2M/%2d. "Text2D → Extended... → Decimal number substitution  → Persian digit number substitution" must be enabled to change the figures.