[R] Time conversion from Win32 64bit FILETIME?

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Oct 19 18:21:08 CEST 2006


On Thu, 19 Oct 2006, Derek Eder wrote:

> Windows-32 has a time structure called FILETIME, a 64-bit value
> representing the number of 100-nanosecond intervals since January 1,
> 1601 (UTC).   That is not a typo, the year is 1601.
>
> Does anyone have a clue(or algorhithm)for how this is converted to
> something a little more POSIX-like ?

ISOdatetime(1601, 1, 1, 0, 0, "UTC") + x/1e7

looks about right, although you won't manage to get the full 64-bit time 
into R.  However, you can also use Windows system calls such as 
FileTimeToSystemTime to do the conversion.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list