Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Daylight time change in C++ 1

Status
Not open for further replies.

PavelGur

Programmer
Sep 21, 2001
75
0
0
I have a time problem since last Sat. Though my computer automatically got daylight saving time my C++ program that adds new row to MS Access table using CTime::GetCurrentTime()is still inserting time that one hour less than currentt iime. I checked Control Panel and it has correct daylight saving time in it. I forced it synchronize with network and still I have wrong time in the table.
BTW it was not the problem last fall when time was changed.
Does anybody knows how to correct it.
Thanks, Pavel.
 
Didn't you know that CTime::GetSystemTime returns current day and time in Coordinated Universal Time (UTC)? No any daylight saving times! That's why UTC was invented.
If you want local time, use CTime::GetLocalTime...
Think again, may be the best choice for database is UTC date/time field (no time clashes).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top