From: CWBillow
| Of these two, the first still gave me errors (10 second pause), but
| the second one worked fine.
|
| dd2=Md "%@date[%_date %_time]
| dd3=Md "%@replace[/,-,%_date] %@replace[:,.,%_time]"
From the format, I presume you do this in an alias definition file. Did you look at _isodate?
One more comment. The method of obtaining the date and time in separate calls to the OS has bit me in the past - if you happen to do it within a few milliseconds before midnight, the date and time returned could be from different days, resulting in a combination nearly 24 hours obsolete... Two methods available to fix this, one a lot more elaborate than would suit an alias: get date, get time, get date again - if dates mismatch, get time again. The other is to use the single call made obtaining _DATETIME, and editing its value into the format you want, along the lines (NOT TESTED!!!):
alias dd=`SET z=%_datetime %+ MD "%@instr[0,4,%z]-%@instr[4,2,%z]-%@instr[6,2,%z] %@instr[8,2,%z].%@instr[10,2,%z].%@instr[12,2,%z]"`
BTW, you can force _date and _time to return data in the format you want by setting the registry format for short date and time, either temporarily (for the execution of the MD command), or permanently.
--
HTH, Steve