Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store Seconds in the log file?
Message
 
 
To
07/01/2023 15:42:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01685718
Message ID:
01685722
Views:
28
>>>>Hi,
>>>>
>>>>I have two questions, please.
>>>>
>>>>1. Does it make sense to store seconds in a log file of problems? I use two approach (I know I should be consistent). In some functions/methods I store the SECONDS in the log file. As:
>>>>
>>>>12/21/2021 10:03:03 PM
>>>>
>>>>Some other LOG files I set the SECONDS off (using SET SECONDS OFF). So the log file would have an entry starting with
>>>>
>>>><pre>
>>>>12/21/2021 10:03 PM
>>>>
>>>>I was just wondering, what do you think should be a good practice? At least, in your app, do you remove seconds?
>>>>
>>>>2. To set the DATE and TIME in the log file, I use the function TTOC(DATETIME()). But in the log file of Euro customers, sometimes I see the date in American format; otherwise, it is in British format.
>>>>What is a good practice? Consistently sing local DATE setting (that is, for Euro - British, for USA - American)? Or set the DATE to American regardless where the log is created?
>>>
>>>For logs I always use the ANSI date (yes, american standard), like this:
>>>2022-06-12 14:26:15
>>>
>>>And sometimes the seconds aren't enough, but then the VFP's datetime resolution doesn't keep the milliseconds so some speed measurements require more iterations to find out how long things take (short of using the profiler).
>>>
>>>BTW, out of few thousand pages on my website, guess which one was always the most visited: the one where I explain the dreaded am/pm. It does require such an explanation, because it doesn't make sense. You get used to it, but it's actually an unnecessary knowledge.
>>
>>I hear you that you do use seconds. I make the change. When you are saying ANSI date format, I will use SET DATE To American. And function TTOC(datetime()). Hopefully this is the ANSI format.
>
>I meant set date ansi.
>
>The american date format doesn't make no sense, it's as if you're saying you owe two dollars, eight cents and eight thousand. Everywhere else we put larger units first, even for time, except for (non-asian) dates, where we go from smaller to larger (day-month-year). The only exception is american date, which goes middle-smaller-larger. And then stuck to it for all the wrong reasons.

When a run a small test in command window and SET DATE TO AMERICAN or SET DATE TO ANSI, the result is the same. The way I test is:
? datetime()
In which case SET DATE TO AMERICAN would be different than SET DATE TO ANSI?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform