delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/24/19:22:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: ericblake AT comcast DOT net (Eric Blake)
To: cygwin AT cygwin DOT com
Subject: Re: strptime error when setting a different TimeZone with export TZ=UTC
Date: Fri, 24 Jun 2005 23:22:41 +0000
Message-Id: <062420052322.8818.42BC95C10004FF940000227222064244130A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

> 
> Actually tm_mon must be in the range [0,11].  You might have been
> thinking of tm_mday which unlike all the others is 1-based, [1,31]. 

You got me, and I even had the POSIX spec open in front of me when
I read the wrong line as to which field was 1-based. :)

 In
> this particular example though it's probably sufficient to initialize tm
> with { 0 } since both tm_mday and tm_mon should be filled in by strptime
> on success.  However, to truly be correct you'd have to check not only
> that strptime didn't return NULL, but that it parsed the entire format
> string and stopped at the expected point rather than failing early.

Isn't portable programming fun?

--
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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