Article View: borland.public.cppbuilder.nativeapi
Article #6280strftime %#c not working with swedish locale
From: Fredrik Bergstr�m
Date: Sat, 21 May 2005 13:24
Date: Sat, 21 May 2005 13:24
38 lines
1922 bytes
1922 bytes
strftime %#c gives strange output when compiling in Borland Compilers, I have tried BCC55, Borland BuilderX and Borland C++ Buider 6 and I get the same output on them all.
I have forced swedish locale.
Output when compiled with MS Compiler:
den 21 maj 2005 15:16:32
Output when compiled with Borland Compiler:
21en 21 maj 2005 15:17:56
Also, almost none of the other %# codes work with the Borland Compiler. "%Y %#m %#d - %#H %#M %#S" will for example be mostly zeros.
What should I do to get around this? What do you think would be the easiest way, making a dll file in VC and linking it maybe?.
/Fredrik
-- code --
#include <stdio.h>
#include <time.h>
#include <locale.h>
int main(void)
{
struct tm *time_now;
time_t secs_now;
char str[80];
setlocale(LC_TIME, "swedish");
tzset();
time(&secs_now);
time_now = localtime(&secs_now);
strftime(str, 80, "%#c", time_now);
printf("%s\n",str);
return 0;
}
Technical Details
Message-ID:
<428f3697$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.gamma.ru!Gamma.RU!image.surnet.ru!newsfeed.rtcomm.ru!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dff135440cddd34d,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Fredrik Bergstr�m" <fredrik-ml@klocktornet.com> Sender: "Fredrik Bergstr�m" <fredrik-ml@klocktornet.com> Reply-To: "Fredrik Bergstr�m" <fredrik-ml@klocktornet.com> Subject: strftime %#c not working with swedish locale Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 83.227.151.159 X-Forwarded-For: 172.16.18.11 NNTP-Posting-Host: 207.105.83.66 Message-ID: <428f3697$1@newsgroups.borland.com> Date: 21 May 2005 06:24:39 -0700 X-Trace: newsgroups.borland.com 1116681879 207.105.83.66 (21 May 2005 06:24:39 -0700) Lines: 38 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.gamma.ru!Gamma.RU!image.surnet.ru!newsfeed.rtcomm.ru!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail