On Fri, 10 Apr 2009 18:07:20 +0400, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:
> Hello, > > I want to port the function setFileTimes available in Phobos/Posix to > Windows. Does anyone know of a simple way to convert a d_time value to a > FILETIME value? d_time is Ticks since 1-1-1970 and FILETIME contains > quanta of 100-nanoseconds since 1-1-1601. So there's only some shifting > and scaling involved, but the shifting constant is tricky :o). > > Andrei You may take a look at Boost Posix Time System: http://www.boost.org/doc/libs/1_38_0/doc/html/date_time/posix_time.html It has a plenty of functions that convert time to and from various formats, including Posix time and Windows FILETIME.