This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Different output of strftime in GCC/Cygwin compared to other compilers/OS


> -----Original Message-----
> From: cygwin-owner@sources.redhat.com
> [mailto:cygwin-owner@sources.redhat.com]On Behalf Of Mathis Severin
> Sent: 22 August 2000 15:32
> To: 'cygwin@sourceware.cygnus.com'
> Subject: Different output of strftime in GCC/Cygwin compared to other
> compilers/OS
>
>
> Hello
>
> I recognized, that the output of the strftime function from GCC
> under Cygwin
> looks quite different to the output of other compilers. I did not find any
> hint to this difference in documentation or archives. Is there a reason
> behind this or can it be influenced by some settings?
>
> Output of:
> = GCC 2.95.2 on Cygwin 1.2.2
> --> Sat Aug 12 2000 13:23:12
>
> Output of:
> = GCC 2.95 on Redhat Linux 6.0
> = Visual C++ 6.0 on NT 4.0
> = aCC A.01.15 on HP-UX 10.20
> --> 08/12/00 13:23:12
>
> The code I used for this test is:
> #include <time.h>
> #include <stdio.h>
>
> int main(void)
> {
> struct tm theTime;
> char theString[26];
>
>   theTime.tm_sec = 12;    /* seconds after the minute - [0,59] */
>   theTime.tm_min = 23;    /* minutes after the hour - [0,59] */
>   theTime.tm_hour = 13;   /* hours since midnight - [0,23] */
>   theTime.tm_mday = 12;   /* day of the month - [1,31] */
>   theTime.tm_mon = 7;     /* months since January - [0,11] */
>   theTime.tm_year =100;   /* years since 1900 */
>   theTime.tm_wday = 6;    /* days since Sunday - [0,6] */
>   theTime.tm_yday = 225;  /* days since January 1 - [0,365] */
>   theTime.tm_isdst = 1;   /* daylight savings time flag */
>   strftime(theString, sizeof(theString), "%x %X", &theTime);

%x and %X return the date and time representation for the current locale.
Hence the probable cause for the difference.

>   printf("-->%s<--\n", theString);
>   return(0);
> }
>
> Best regards,
> Severin Mathis
>
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>

Regards,

Graham Bloice


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]