Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 82391 invoked by uid 500); 17 Jul 2002 19:31:39 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 82310 invoked from network); 17 Jul 2002 19:31:36 -0000 X-Authentication-Warning: rdu88-250-182.nc.rr.com: trawick set sender to trawick@attglobal.net using -f Sender: trawick@rdu88-250-182.nc.rr.com To: jim@jaguNET.com Cc: rmorgan@covalent.net (Ryan Morgan), dev@apr.apache.org Subject: Re: apr_strftime not portable References: <200207171923.PAA15706@devsys.jaguNET.com> From: Jeff Trawick Date: 17 Jul 2002 15:38:10 -0400 In-Reply-To: <200207171923.PAA15706@devsys.jaguNET.com> Message-ID: Lines: 35 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Jim Jagielski writes: > Ryan Morgan wrote: > > > > > > apr_strftime calls the platform's native strftime, which differs between > > platforms (solaris and linux for example). take the following code: > > > > apr_explode_localtime(&xt, apr_time_now()); > > apr_strftime(buf, &retcode, sizeof(buf), "%G", &xt); > > > > this will result in buf containing '2002' on linux and '%G' on solaris. > > (because solaris strftime does not support %G, but linux does) > > > > IIRC, '%G' is not ANSI, but an extension on Linux and some others. > Solaris doesn't have it, neither does Darwin. What's the diff between > %G and %Y (year with century)? Linux: %G The ISO 8601 year with century as a decimal number. The 4-digit year corre- sponding to the ISO week number (see %V). This has the same format and value as %y, except that if the ISO week number belongs to the previous or next year, that year is used instead. (TZ) FreeBSD: %G is replaced by a year as a decimal number with century. This year is the one that contains the greater part of the week (Monday as the first day of the week). -- Jeff Trawick | trawick@attglobal.net Born in Roswell... married an alien...