Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2006

Tip: Looking for answers? Try searching our database.

Parse date and time in unmanaged C++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Altman - 28 Jun 2006 21:57 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.