Is there any way to remove the colon between the date and the time that is written to the file by this command.
2004-05-11:08:30:04:578 would look like 2004-05-11 08:30:04:578
I think it would be more readable.
DateStamp command
Moderators: JRL, Dorian (MJT support)
-
- Newbie
- Posts: 18
- Joined: Fri Mar 19, 2004 4:59 pm
- Location: Ephrata, Washington USA
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
To get a timestamp in a log file
From this: 2004-05-11:08:30:04:578
To this: 2004-05-11 08:30:04:578
You could try something like this:
From this: 2004-05-11:08:30:04:578
To this: 2004-05-11 08:30:04:578
You could try something like this:
Be sure to eliminate any Trailing Space Characters.//Send TimeStamp to Temporary file
TimeStamp>TempFile
//Read contents of temporary file
ReadLn>Tempfile,1,DateTime
//Parse line in temp file to get Date, Time, Comment
MidStr>DateTime,1,10,DateStr
MidStr>DateTime,12,12,TimeStr
MidStr>DateTime,24,300,Comment
//Rebuild TimeStamp contents
Let>Stamp=%DateStr% %TimeStr% %Comment%
//Send rebuilt line to original log file
WriteLn>LogFile,result,%Stamp%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
-
- Newbie
- Posts: 18
- Joined: Fri Mar 19, 2004 4:59 pm
- Location: Ephrata, Washington USA
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Good shortcut for the front end Lumumba.
And I see you are also willing to forget the comments in the normal TimeStamp?
Nah, you/ve just provided this to replace the MidStr functions I used.
We do all this, and he is just asking for an enhancement to the program!

And I see you are also willing to forget the comments in the normal TimeStamp?

We do all this, and he is just asking for an enhancement to the program!


Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Have taken this from the settings of "Dave's Quik Search Desk Bar" as a sample for "some" parameters used with date/time
/* The clock is formatted according to the following format strings:
* yyyy - four digit year (2001)
* yy - two digit year (01)
* MMMM - fully spelled month name (January)
* MMM - abbreviated month name (Jan)
* MM - zero-padded month number (01)
* M - month number (1)
* dd - zero-padded day-of-month number (01)
* d - day-of-month number (1)
* hh - zero-padded 12-hour clock hour (01)
* h - 12-hour clock hour (1)
* HH - zero-padded 24-hour clock hour (01, 13)
* H - 24-hour clock hour (13)
* mm - zero-padded minutes value (00)
* ss - zero-padded seconds value (00)
* a - 12-hour clock am/pm lowercase (am)
* A - 12-hour clock am/pm uppercase (AM)
* EEEE - day-of-week full name (Monday)
* EEE - day-of-week abbreviation (Mon)
* default long form = " EEE d MMM yyyy h:mm A "
* default short form = " h:mm A "
* clocklongform = " EE MM dd, yyyy h:mm A ";
*/
A sample result out of the above:
clocklongform = " EEEE, dd.MM.yyyy - HH:mm ";
clockshortform = " h:mm A ";
So something like this isn't to far away from it (workaround
):
Let>MyTimestamp = %YEAR%-%MONTH%-%DAY% %HOUR%:%MIN%:%SEC%
and yep, it was just a part of the big picture
Label>Check
.
.
.
If>x=s, Success, Error
Label>Success
Let>StatusMessage = SUCCESS
Goto>WriteLog
Label>Error
Let>StatusMessage = ERROR
Label>WriteLog
Let>MyTimestamp = %YEAR%-%MONTH%-%DAY% %HOUR%:%MIN%:%SEC%
WriteLn>LogFile,result,%MyTimestamp% - %StatusMessage%
Goto, Check

/* The clock is formatted according to the following format strings:
* yyyy - four digit year (2001)
* yy - two digit year (01)
* MMMM - fully spelled month name (January)
* MMM - abbreviated month name (Jan)
* MM - zero-padded month number (01)
* M - month number (1)
* dd - zero-padded day-of-month number (01)
* d - day-of-month number (1)
* hh - zero-padded 12-hour clock hour (01)
* h - 12-hour clock hour (1)
* HH - zero-padded 24-hour clock hour (01, 13)
* H - 24-hour clock hour (13)
* mm - zero-padded minutes value (00)
* ss - zero-padded seconds value (00)
* a - 12-hour clock am/pm lowercase (am)
* A - 12-hour clock am/pm uppercase (AM)
* EEEE - day-of-week full name (Monday)
* EEE - day-of-week abbreviation (Mon)
* default long form = " EEE d MMM yyyy h:mm A "
* default short form = " h:mm A "
* clocklongform = " EE MM dd, yyyy h:mm A ";
*/
A sample result out of the above:
clocklongform = " EEEE, dd.MM.yyyy - HH:mm ";
clockshortform = " h:mm A ";
So something like this isn't to far away from it (workaround

Let>MyTimestamp = %YEAR%-%MONTH%-%DAY% %HOUR%:%MIN%:%SEC%
and yep, it was just a part of the big picture

Label>Check
.
.
.
If>x=s, Success, Error
Label>Success
Let>StatusMessage = SUCCESS
Goto>WriteLog
Label>Error
Let>StatusMessage = ERROR
Label>WriteLog
Let>MyTimestamp = %YEAR%-%MONTH%-%DAY% %HOUR%:%MIN%:%SEC%
WriteLn>LogFile,result,%MyTimestamp% - %StatusMessage%
Goto, Check