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


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

Re: time conversion

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!wieslauf.sub.de!.POSTED!reversiblemaps.ath.cx!not-for-mail
From Jasen Betts <jasen@xnet.co.nz>
Newsgroups comp.os.linux.development.apps
Subject Re: time conversion
Date 28 Jan 2012 21:15:42 GMT
Organization Dis (not Dat) Organisation
Lines 24
Message-ID <jg1ohu$m4e$1@reversiblemaps.ath.cx> (permalink)
References <jfsjn2$4hm$1@dont-email.me>
NNTP-Posting-Host ip-118-90-69-86.xdsl.xnet.co.nz
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace wieslauf.sub.de 1327910020 10840 118.90.69.86 (30 Jan 2012 07:53:40 GMT)
X-Complaints-To usenet@wieslauf.sub.de
NNTP-Posting-Date Mon, 30 Jan 2012 07:53:40 +0000 (UTC)
User-Agent slrn/pre1.0.0-18 (Linux)
X-Face ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s;a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W;(T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q;8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^
Xref x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:410

Show key headers only | 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