Article View: borland.public.cppbuilder.nativeapi
Article #9601Re: epoc time
From: borland
Date: Tue, 22 Jun 2004 10:45
Date: Tue, 22 Jun 2004 10:45
26 lines
1742 bytes
1742 bytes
Thanks.. "Andrue Cope [TeamB]" <no.spam@spammy.com> wrote in message news:40d80ca1$1@newsgroups.borland.com... > 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:
<40d80dc2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40d80572$1@newsgroups.borland.com> <40d80ca1$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: "borland" <rogersmail@ntlworld.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40d80572$1@newsgroups.borland.com> <40d80ca1$1@newsgroups.borland.com> Subject: Re: epoc time Date: Tue, 22 Jun 2004 11:45:25 +0100 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2739.300 NNTP-Posting-Host: 81.103.69.122 Message-ID: <40d80dc2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1087901122 81.103.69.122 (22 Jun 2004 03:45:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail