Article View: borland.public.cppbuilder.nativeapi
Article #9600Re: epoc time
From: Andrue Cope [TeamB]
Date: Tue, 22 Jun 2004 10:40
Date: Tue, 22 Jun 2004 10:40
23 lines
1708 bytes
1708 bytes
borland wrote: > How can i get the epoc time in seconds since 1970 etc. like the > unix_timestamp does.? There is a VCL function DateTimeToUnix() but I don't know if there is an API function. It's easily enough accomplished though: 1.Use GetSystemTimeAsFileTime() to obtain the number of 100-nanosecond intervals since January 1, 1601 2.Use SystemTimeToFileTime() to generate the FILETIME for January 1, 1970. 3.Subtract (2) from (1) 4.Multiply (3) by 0.00000009 And there you have it. Actually (4) might be the wrong multiple but basically you want to convert from 100-nanosecond intervals to one second intervals. -- Andrue Cope [TeamB] [Bicester, Uk] http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<40d80ca1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!216.218.192.242!news.he.net!dimensional.com!pulsar.dimensional.com!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40d80572$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,68487330a3e2f49d X-Google-Attributes: gid10cc67,public From: "Andrue Cope [TeamB]" <no.spam@spammy.com> Subject: Re: epoc time Newsgroups: borland.public.cppbuilder.nativeapi References: <40d80572$1@newsgroups.borland.com> User-Agent: XanaNews/1.16.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 217.207.223.34 Message-ID: <40d80ca1$1@newsgroups.borland.com> Date: 22 Jun 2004 03:40:33 -0700 X-Trace: newsgroups.borland.com 1087900833 217.207.223.34 (22 Jun 2004 03:40:33 -0700) Lines: 23 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.sjc.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!216.218.192.242!news.he.net!dimensional.com!pulsar.dimensional.com!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail