tz patch for C99 strftime

Paul Eggert eggert at twinsun.com
Mon Nov 8 18:51:33 UTC 1999


   Date: Mon, 8 Nov 1999 16:06:01 +0000
   From: "Clive D.W. Feather" <clive at demon.net>

   > %c equivalent to ``%a %b %e %T %Y''.
   > %p one of ``AM'' or ``PM''.
   > %x equivalent to ``%m/%d/%y''.

Thanks for the heads-up.  This means that the tz strftime needs to be
fixed to conform to C99.  Here's a proposed patch.

===================================================================
RCS file: RCS/strftime.c,v
retrieving revision 1996.12
retrieving revision 1996.12.0.1
diff -pu -r1996.12 -r1996.12.0.1
--- strftime.c	1996/09/08 20:14:01	1996.12
+++ strftime.c	1999/11/08 18:39:37	1996.12.0.1
@@ -80,24 +80,21 @@ static const struct lc_time_T	C_time_loc
 
 	/*
 	** x_fmt
-	** Since the C language standard calls for
-	** "date, using locale's date format," anything goes.
+	** C99 requires this format.
 	** Using just numbers (as here) makes Quakers happier;
 	** it's also compatible with SVR4.
-	**
-	** XXX--might it be better to use the year-2000 friendly
-	**	%Y-%m-%d
-	** here?
 	*/
 	"%m/%d/%y",
 
 	/*
 	** c_fmt
+	** C99 requires this format.
+	** Previously this code used "%D %X", but we now conform to C99.
 	** Note that
-	**	"%a %b %d %H:%M:%S %Y"
+	**      "%a %b %d %H:%M:%S %Y"
 	** is used by Solaris 2.3.
 	*/
-	"%D %X",	/* %m/%d/%y %H:%M:%S */
+	"%a %b %e %T %Y",
 
 	/* am */
 	"AM",



More information about the tz mailing list