DateTime.nlm creates a new console command "DT" that prints the current date/time to the logger screen.

Module is DateTime.NLM, usage is:

Load DateTime

then from console or .ncf file

DT <format string>

where <format string> can include:

c - shortdateformat   ’ ’   shorttimeformat
d - day of month
dd - day of month (leading zero)
ddd - day of week (abbreviation)
dddd - day of week (full)
ddddd - shortdateformat - eg 15-01-08
dddddd - longdateformat - eg 15 January 2008
m - month
mm - month (leading zero)
mmm - month (abbreviation)
mmmm - month (full)
y - year (four digits)
yy - year (two digits)
yyyy - year (with century)
h - hour
hh - hour (leading zero)
n - minute
nn - minute (leading zero)
s - second
ss -second (leading zero)
t - shorttimeformat
tt - longtimeformat
am/pm - use 12 hour clock and display am and pm accordingly
a/p -use 12 hour clock and display a and p accordingly
/ - insert date separator
: -insert time separator
'xx' or "xx" literal text

Note that literal strings need to be in quotes eg: "some text" or 'some text'
so eg:

cmd: DT

out:   2008-1-15 11:28

cmd: DT hh:nn:ss am/pm

out:   11:28:12 am

cmd: DT "Starting cron job:" ddd dd-mm-y hh:nn:ss am/pm

out:   Starting cron job: Tue 15-01-2008 11:28:12 am



Comment List
Related Discussions