LabTalk:Date and Time Format Specifiers

From LabTalk Wiki

Jump to: navigation, search

[edit] Date Time Specifiers

Date and time format specifiers for custom date and time output.

Specifier Description
d Day number, no leading zero
dd Day number, with leading zero
ddd 3-character day name
dddd Full day name
M Month number, no leading zero
MM Month number, leading zero
MMM 3-character month name
MMMM Full month name
yy 2-character year (Input < 45 interpreted as 20yy)
yyyy 4-character year
h Hour, no leading zero (12 hour time)
hh Hour, with leading zero (12 hour time)
H Hour, no leading zero (24 hour time)
HH Hour, leading zero (24 hour time)
m Minute, no leading zero
mm Minute, with leading zero
s Second, no leading zero
ss Second, with leading zero
# Fractional seconds (each # is one decimal place, up to 6)
t Displays A or P (for AM and PM)
tt Displays AM or PM

[edit] Example

newbook;
col(1)[1] = @D;
wks.col1.setformat(4,22,dddd', 'MMMM' 'dd', 'yyyy' 'hh':'mm' 'tt);
wks.col1.width = 24;

Personal tools