Hi all,
I need to simulate current date and time and provide integer values for the
current year, month, day, hour, minute, second, and millisec. I need to do
this in unmanaged C++. My first inclination is to do roughly the same thing
that I would do in managed code: I would maintain a 64-bit integer value
that represents the number of millisec. (or nanosec.) since some date. I
would periodically increment this integer by the appropriate amount. My
question is, is there an unmanaged C/C++ function (maybe something buried in
the Windows API) that can perform the year/month/date conversion for me?
TIA!
Brian Muth - 28 Jun 2006 22:57 GMT
My personal favourite time-date routines is CComDate found at
http://www.sellsbrothers.com/tools/
Brian
Sean M. DonCarlos - 28 Jun 2006 23:11 GMT
> Hi all,
>
[quoted text clipped - 7 lines]
> the Windows API) that can perform the year/month/date conversion for me?
> TIA!
See the Win32 FILETIME and SYSTEMTIME structures and associated functions
like FileTimeToSystemTime. They do almost exactly what you describe above,
and can do additional things like time zone conversion, locale-specific
calendars, and more. I use them for all sorts of unmanaged date/time tasks.
Sean