Date Time Formats

Date and time formats can be set from the table and from many locations in Strater. Date and time options are case sensitive. Months always need to be entered with upper case M and minutes must always be entered with lower case m.

 

When dates are parsed during input/import, the month and day of week names must match those of the local language as set in the Windows Control Panel, otherwise the entry will not be recognized as a valid date and will be treated as a text string.

 

When the recognized format is ambiguous (i.e. 10/7/12), the month, day, and year order is determined by the Windows locale. In some countries, this will be recognized as M/d/yy, in others as d/M/yy, and in others as YY/M/d. It is important to use non-ambiguous date/time formats when the Windows locale may change.

 

Date/Time Formatting Tips

 

Date/Time Formats

These are the defined date and time formats. These can be used in the worksheet Format Cells dialog, in the Property Manager label format section, or from the Text Editor's Date/Time Format Builder dialog. Any combination of these formats can be used in any of the locations.

 

All rows below use the date July 9, 2014 at 6:45:44.12345 in the evening for the Example.

 

Date/Time Code

Example

Description

d

9

Single digit day, excluding leading zero

dd

09

Double digit day, including leading zero

ddd

Wed

Shortened day of week name

dddd

Wednesday

Full day of week name

M

7

Single digit month, excluding leading zero

MM

07

Double digit month, including leading zero

MMM

Jul

Shortened month name

MMMM

July

Full month name

MMMMM

J

First letter of month name

yy

98

Two digit year

yyyy

1998

Full year

g

 

Before Common Era designator - Includes space and bce or nothing if ce, lower case

gg

 ad

BC/AD designator - Includes space and bc or ad, lower case

ggg

 ce

Before Common Era designator - Includes space and bce or ce, lower case

G

 

Before Common Era designator - Includes space and BCE or nothing if CE, upper case

GG

 AD

BC/AD designator - Includes space and BC or AD, upper case

GGG

 CE

Before Common Era designator - Includes space and BCE or CE, upper case

h

6

Single digit hours - 1-12, excluding leading zero

hh

06

Double digit hours - 01-12, including leading zero

H

18

Hours - 0-23 military, excluding leading zero

HH

18

Hours - 00-23 military, including leading zero

[h]

1003914

Hours portion of total time, excludes leading zeros

m

45

Minutes - 0-60, excluding leading zero

mm

45

Minutes - 00 to 60, including leading zero

[mm]

45

Minutes portion of total time, includes leading zeros

ss

44

Seconds - 0-60, rounded to the nearest second

ss.0

44.1

Seconds - 0-60, rounded to the nearest tenth of a second

ss.00

44.12

Seconds - 0-60, rounded to the nearest hundredth of a second

ss.000

44.123

Seconds - 0-60, rounded to the nearest millisecond

ss.0000

44.12345

Seconds - 0-60, maximum precision

[ss]

44

Seconds portion of total time, includes leading zeros

tt

pm

am or pm designator, lower case

TT

PM

AM or PM designator, upper case

\

 

escape character - output next character verbatim

'...'

 

output ALL characters between single quotes verbatim, including escape character

[$-xxxx]

[$-409]

xxxx is an up to four hex digit representation of a locale ID

 

 

 

See Also

Format Cells - Number Page