11-29-2008, 06:07 AM
This is a short code I use for this purpose :
You may redirect output to any logfile.
Now() is a current time output function :
Function Now
You may redirect output to any logfile.
Now() is a current time output function :
Function Now
;\
function~ [int'sw] [str&sdatim]
;Calling : out Now(0)
str sval s s1 s2
s.time
sel sw
;Date & Time
,case 0
,,sval=s
,,s1.time("yyMMdd")
,,s2.time("gg" "HHmmss")
,,s2.ltrim(" ")
,,s1 + s2
;Date
,case 1
,,sval.left(s 8)
,,s1.time("yyMMdd")
,case 2
;Time
,,sval.right(s 8)
,,s1.time("gg" "HHmmss")
,,s1.ltrim(" ")
,,
,case else
,,s.from("Illegal value : " sw)
,,mes s "Now"
if getopt(nargs)=2; sdatim = s1
ret sval