timelocal() on Tues., Oct. 05, 1993

James Stern jsternitg@yahoo.com
Tue Sep 21 17:56:00 GMT 1999


timelocal() is reporting the same result for two
different times.  My first thought was that this was
related to a Daylight/Standard Time switchover but it
happens on a Tuesday.

I did this:

<snip>

% cat a.cc
#include <iostream>
using std::cout;
#include <cstdlib>
#include <ctime>
int main(int argc, char* argv[]) {
        tzset();
        std::time_t now = std::atol(argv[1]);
        struct std::tm* const t =
std::localtime(&now);
        cout << now << " " << std::asctime(t) << endl;
        return 0;
}

% cat script
g++ a.cc
./a.exe 749804400
./a.exe 749808000       # 1 hour later

% ./script
749804400 Tue Oct 05 00:00:00 1993

749808000 Tue Oct 05 00:00:00 1993
<snip>

I added the tzset() because it's mentioned in the FAQ.
 However, as I feared, it didn't help.
===
-- 
Opinions expressed above are not necessarily my employer's.
James M. Stern
ITG Inc.  Culver City, CA (213) 270-7955
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list