Information générale
Catégorie:
Codage, syntaxe et commandes
>>ACK to Dragan and order of numbers.
>>But as total app often needs local D/DT settings, I prefer ttoc(,3) or ttoc(,1) in .txt logs.
>>No danger of wrong set carried over by some dumb error.
>
>Yep, agree on using something that that doesn't depend on SET DATE and SET CENTURY, as well as using 24-hour rather than 12-hour format for time portion.
>
>In case you wanted to "pretty up" the timestamp, you could use expression such as:
>STUFF(STUFF(STUFF(STUFF(STUFF(TTOC(DATETIME(),1),13,0,":"),11,0,":"),9,0," "),7,0,"-"),5,0,"-")
>to get it in the format YYYY-MM-DD hh:mm:ss
I'd probably go for chrtran(ttoc(datetime(),3), "T", " "))
from pure typing lazyness, not from premature optimization
;-))
>
>>If your own pref sometimes favors MDY, consider dbf logs.
>>makes often sense, esp. if you view log as technical part.
>>Users prone to give you their ideas or interpretation instead of info won't read the log
>>Users with minimal knowledge can read (and set DT to their pref if given viewer or some tech info
>>Size limit of 2GB minimally enhanced if using memo file for variable text part.
>>(I prefer to get log mailed instead of user calling me with log info they read)
>
>That's another good idea -- this also gives you option to do some form of reporting upon the logs.
>
>On a similar note -- if I am generating some sort of output file with the date encoded into it, I opt for something that has YYYYMMDD format rather than something local date format --- mainly so that usual sorting alphabetically will also sort the files by date/time automatically. File timestamps aren't preserved whenever a file gets transferred (e.g. E-mail, FTP, etc.).
Similar thinking here:
I append (mostly date only) version info to the file name and
have simple utility to touch file time stamps according to appended date/datetime.
gives me the benefit of 2 search orders: correct date as specced in file name appendix and
mnemonic filename start (authorshort/target/topic).
regards
thomas
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement