Subject: strftime ambiguity: %-codes differ from Unix
From: [email-masked] (James Dumser)

16 Jan 1997 08:29:07 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
X-Mailer: ELM [version 2.4 PL23]
Content-Length: 1673      
Original-Sender: [email-masked]

I recently ported nenscript-1.13++ to cygwin32 and noticed that the
strftime strings needed to be in the "DOS" style rather than the normal
"Unix" style (the hunk below is from the Unix section of machdep.h):
  diff -ur nenscript-1.13++/machdep.h nenscript.local/machdep.h
  --- nenscript-1.13++/machdep.h	Wed Dec 31 17:58:34 1969
  +++ nenscript.local/machdep.h	Thu Dec 19 09:16:32 1996
  @@ -56,12 +56,24 @@
   
   # define	USERNAME	((getpwuid (getuid()))->pw_name)
   
  -# define 	GETTIME(tm,str)	strftime(str,15,"%T",tm)
  +# ifdef __CYGWIN32__
  +#  define 	GETTIME(tm,str)	strftime(str,15,"%X",tm)
  +# else
  +#  define 	GETTIME(tm,str)	strftime(str,15,"%T",tm)
  +# endif
   
  -# ifdef US_VERSION
  -#  define	GETDATE(tm,str) strftime(str,15,"%h %d %y",tm)
  +# ifdef __CYGWIN32__
  +#  ifdef US_VERSION
  +#   define	GETDATE(tm,str) strftime(str,15,"%b %d %y",tm)
  +#  else
  +#   define	GETDATE(tm,str) strftime(str,15,"%d %b %y",tm)
  +#  endif
   # else
  -#  define	GETDATE(tm,str) strftime(str,15,"%d %h %y",tm)
  +#  ifdef US_VERSION
  +#   define	GETDATE(tm,str) strftime(str,15,"%h %d %y",tm)
  +#  else
  +#   define	GETDATE(tm,str) strftime(str,15,"%d %h %y",tm)
  +#  endif
   # endif
   
   #endif

While I know we can't have it both ways and have it transparent for both
camps, I was wondering if this was an explicit choice to implement the
DOS codes when the main goal of the project is to compile GNU-type
software under 95/NT. I did not see this discrepancy mentioned in any of
the online documentation (tho I could have missed it -- would be nice to
be able to search all the documentation...)

-- 
James Dumser    972-462-5335 [email-masked]

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".