Board index » cppbuilder » time() uses US Summer Time?
Johannes Weinert
CBuilder Developer |
Johannes Weinert
CBuilder Developer |
time() uses US Summer Time?2008-03-26 09:22:45 PM cppbuilder66 Hello, I'm using time() to retrieve GMT. I'm located in Europe and Summer Time starts next weekend. So I expected time() to return current time - 1h. But since March 9th it returns current time - 2h. Is is correct behavior of time()? Can I specify the local time zone somehow or is this a bug? I will work around using GetSystemTime() but I'm curious if the behavior is intended. TIA, Hans |
Darko Miletic
CBuilder Developer |
2008-03-26 11:31:42 PM
Re:time() uses US Summer Time?
Johannes Weinert wrote:
QuoteHello, Are you using time like this to get GMT time? #include <ctime> #include <iostream> std::time_t tim = std::time(NULL); struct std::tm *ts = std::gmtime(&tim); |
Johannes Weinert
CBuilder Developer |
2008-03-26 11:59:48 PM
Re:time() uses US Summer Time?
Darko Miletic wrote:
QuoteJohannes Weinert wrote: QuoteAre you using time like this to get GMT time? I'm using UnixToDateTime(time(NULL)); to get UTC as TDateTime. But even if I'm using your code the time is wrong (local time minus 2 hours instead of 1 hour). The question stays the same, is this a bug? TIA Hans {smallsort} |
Darko Miletic
CBuilder Developer |
2008-03-27 12:36:41 AM
Re:time() uses US Summer Time?
Johannes Weinert wrote:
QuoteThe question stays the same, is this a bug? support.codegear.com/article/36200 |
Johannes Weinert
CBuilder Developer |
2008-03-27 01:12:52 AM
Re:time() uses US Summer Time?
Darko Miletic wrote:
QuoteJohannes Weinert wrote: Summer Time from local settings. It would be nice to have a second opinion. I can file a QC report then. BTW, I didn't find a report related to this issue. Regards Hans |
Darko Miletic
CBuilder Developer |
2008-03-27 01:24:31 AM
Re:time() uses US Summer Time?
Johannes Weinert wrote:
QuoteIt would be nice to have a second opinion. I can file a QC report then. get's generated etc. |
Johannes Weinert
CBuilder Developer |
2008-03-27 06:15:25 AM
Re:time() uses US Summer Time?
Darko Miletic wrote:
QuoteJohannes Weinert wrote: std::time() returns CET-2 instead of CET-1 in a time when US is using DST and Europe is not qc.codegear.com/wc/qcmain.aspx Regards Hans |