public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* timelocal() on Tues., Oct. 05, 1993
@ 1999-09-21 17:56 James Stern
  1999-09-30 23:42 ` James Stern
  0 siblings, 1 reply; 2+ messages in thread
From: James Stern @ 1999-09-21 17:56 UTC (permalink / raw)
  To: cygwin; +Cc: joseph, James M. Stern

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* timelocal() on Tues., Oct. 05, 1993
  1999-09-21 17:56 timelocal() on Tues., Oct. 05, 1993 James Stern
@ 1999-09-30 23:42 ` James Stern
  0 siblings, 0 replies; 2+ messages in thread
From: James Stern @ 1999-09-30 23:42 UTC (permalink / raw)
  To: cygwin; +Cc: joseph, James M. Stern

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-21 17:56 timelocal() on Tues., Oct. 05, 1993 James Stern
1999-09-30 23:42 ` James Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).