From: dumser AT ti DOT com (James Dumser) Subject: Re: strftime missing functionality? 29 Jan 1997 09:48:22 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199701291401.IAA12195.cygnus.gnu-win32@lesol1.dseg.ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Original-To: newsham AT aloha DOT net (Tim Newsham) Original-Cc: gnu-win32 AT cygnus DOT com In-Reply-To: <199701290220.QAA20883@haleakala.aloha.net> from "Tim Newsham" at Jan 28, 97 04:20:37 pm X-MIMI-Options: headers none X-Mailer: ELM [version 2.4 PL23] Content-Length: 1760 Original-Sender: owner-gnu-win32 AT cygnus DOT com On Tue, 28 Jan 1997 16:20:37 -1000 (HST), Tim Newsham wrote: > When using strftime() I am getting some missing fields. In >particular: > > strftime(buf, 50, "%d %h %Y %T GMT", gmtime(&t)); > >gives me a buffer: "25 1994 GMT" with missing "%h" and "%T", and > > strftime(buf, 50, "%a %b %d %H:%M:%S %Z %Y", localtime(&t)); > >gives me a buffer: "Sun Dec 25 17:00:00 1994" with missing "%Z". This is due to the (wrong, IMHO) choice to use DOS strftime flags rather than the Unix ones. The DOS flags are as follows (from VC++): %a Abbreviated weekday name %A Full weekday name %b Abbreviated month name %B Full month name %c Date and time representation appropriate for the locale %d Day of the month as a decimal number (01 - 31) %H Hour in 24-hour format (00 - 23) %I Hour in 12-hour format (01 - 12) %j Day of the year as a decimal number (001 - 366) %m Month as a decimal number (01 - 12) %M Minute as a decimal number (00 - 59) %p Current locale's A.M./P.M. indicator for a 12-hour clock %S Second as a decimal number (00 - 59) %U Week of the year as a decimal number, with Sunday as the first day of the week (00 - 51) %w Weekday as a decimal number (0 - 6; Sunday is 0) %W Week of the year as a decimal number, with Monday as the first day of the week (00 - 51) %x Date representation for current locale %X Time representation for current locale %y Year without the century as a decimal number (00 - 99) %Y Year with the century as a decimal number %z Time zone name or abbreviation; no characters if time zone is unknown %% Percent sign You'll probably need to #ifdef __CYGWIN32__ the strftimes and use the DOS codes. -- James Dumser 972-462-5335 dumser AT ti DOT com - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".