Re: Timestamp in the trace files

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Wed, 06 Jan 2010 23:22:41 +0100
Message-ID: <4B450D31.7030804_at_gmail.com>



On 06.01.2010 22:48, Mladen Gogala wrote:
> On Wed, 06 Jan 2010 21:10:56 +0100, Maxim Demenko wrote:
>
>> Sorry, of course, i am interpreting your words like it better suit my
>> needs ;-)
>> But either your meant to say "The application has run on 05-Jan-2010" -
>> in that case my previous post still applies, or it run indeed on
>> 05-Jan-2009 and my math is wrong, but then it is unclear with "The
>> result is January 28th, 2009, which is almost a year off".
>>
>>
>> Best regards
>>
>> Maxim
>
> Maxim, you helped me a lot! It works now. Here is the result, written in
> The algorithm is yours, I just had to apply it properly. Thanks again
> for your help. I must be getting senile these days.
>
> #!/usr/bin/perl -w
> use strict;
> sub cnv_tim($);
>
> sub cnv_tim($) {
> my $A = shift;
> my ( $sec, $min, $hr, $dd, $mm, $yr ) =
> localtime( ( $A * 1024 ) / 1000000000 );
> $yr += 1900;
> $mm++;
> my $str = sprintf( "%d-%d-%d %d:%d:%d\n", $yr, $mm, $dd, $hr, $min,
> $sec );
> return ($str);
> }
> map { print "tim=$_ --> ", cnv_tim($_); } _at_ARGV;
>
>
> Here is how to run it:
>
> mgogala_at_nycwxp2622:/tmp$ ./ttt 1233122413959653
> tim=1233122413959653 --> 2010-1-5 13:49:11
>
>
> You can put as many "tim" timestamps on the command line as necessary,
> the script will convert them all, one line per timestamp. Some people
> object to my function declarations but I used to program in C and have
> carried over some habits.
>
>

I'm glad, it works for you.
The credit goes of course to Andrew Zitelli, i didn't participate in his test, but tested his assumption a couple of times on systems i had access to - and it seems to be the correct rule.

_at_Steve
i agree, it seems, the official documentation is incomplete, keep in mind the differences between solaris/linux and windows (and ...) platforms.

Best regards

Maxim Received on Wed Jan 06 2010 - 16:22:41 CST

Original text of this message