Skip to Content.
Sympa Menu

perfsonar-user - Re: [perfsonar-user] bwctl timestamps

Subject: perfSONAR User Q&A and Other Discussion

List archive

Re: [perfsonar-user] bwctl timestamps


Chronological Thread 
  • From: Alan Whinery <>
  • To:
  • Subject: Re: [perfsonar-user] bwctl timestamps
  • Date: Thu, 18 Sep 2014 00:53:22 -0400

Perl (Unix) doesn't assume an epoch of 1900, but of 1970:

# perl -e 'print scalar gmtime (0)'

  Thu Jan  1 00:00:00 1970

If you subtract 70 years in seconds from the integer part of your timestamp, it's a lot closer:
perl -e 'print scalar gmtime (3619858998 - int(70 * 365.25) * 86400)'
Tue Sep 16 12:23:18 2014


On 9/17/2014 8:32 PM, Hummel, Homer (173D-Affiliate) wrote:

When I run ‘bwctl [other options] –v’, I see timestamps such as the following:

bwctl: start_tool: 3619858998.440725

 

But when I use the localtime function in Perl to convert the above timestamp to wall-clock date/time, which assumes that the beginning of the epoch is year 1900, I get a date that doesn’t make sense, as in the following conversion of the above timestamp:

Tool start time: 2084-09-15 05:23:18

 

The time of day looks okay, but I expected the date to be 2014-09-16

 

How can I convert the timestamp of ‘bwctl’ to a wall-clock date/time correctly?

 

Homer Hummel

 

 





Archive powered by MHonArc 2.6.16.

Top of Page