delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/21/20:56:49

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990922010644.7176.rocketmail@web1405.mail.yahoo.com>
Date: Tue, 21 Sep 1999 18:06:44 -0700 (PDT)
From: James Stern <jsternitg AT yahoo DOT com>
Reply-To: stern AT itginc DOT com
Subject: timelocal() on Tues., Oct. 05, 1993
To: cygwin <cygwin AT sourceware DOT cygnus DOT com>
Cc: joseph AT itginc DOT com, "James M. Stern" <stern AT itginc DOT com>
MIME-Version: 1.0

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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019