Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #410

Re: time conversion

From Jasen Betts <jasen@xnet.co.nz>
Newsgroups comp.os.linux.development.apps
Subject Re: time conversion
Date 2012-01-28 21:15 +0000
Organization Dis (not Dat) Organisation
Message-ID <jg1ohu$m4e$1@reversiblemaps.ath.cx> (permalink)
References <jfsjn2$4hm$1@dont-email.me>

Show all headers | View raw


On 2012-01-26, Bill M <wpmccormick@just_about_everywhere.com> wrote:
> What is the easiest way to convert a time value that is the number
> of microseconds that have elapsed since 0000 hours 1 January 1972 into 
> the unixepoch (the number of seconds since 0000 hours 1 January 1970).
>
> Is there some time function for this already? Or do I need to use struct tm?

no, and no.

divide by 1000000    
  which converts microseconds into seconds 
and then add (2x365x25x60x60) 
  which is the missing tw yars worth of seconds

I am assuming both schemes agree about leap seconds.


hmm, 1972 eh?

You may find enlightenment in the source of ntpdate, but be aware that the
NTP epoch differs by 10 seconds from the one you describe.

-- 
⚂⚃ 100% natural

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

time conversion Bill M <wpmccormick@just_about_everywhere.com> - 2012-01-26 16:22 -0600
  Re: time conversion Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-26 23:01 +0000
    Re: time conversion Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-27 09:18 +0000
    Re: time conversion Josef Moellers <josef.moellers@ts.fujitsu.com> - 2012-01-27 14:20 +0100
      Re: time conversion Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-27 13:50 +0000
        Re: time conversion Bill M <wpmccormick@just_about_everywhere.com> - 2012-01-27 08:19 -0600
  Re: time conversion Jasen Betts <jasen@xnet.co.nz> - 2012-01-28 21:15 +0000
    Re: time conversion Bill M <wpmccormick@just_about_everywhere.com> - 2012-01-31 14:34 -0600

csiph-web