[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: setlocale



On Tue, Jun 07, 2005 at 03:00:47PM +0200, Tadeusz Prokocki wrote:
> Co trzeba zmienic by te setlocale chodzily dobrze ?
> Wstawiałem od groma opcji setlocale i data ciągle in english
> np.
> @setlocale(LC_TIME, 'pl_PL.ISO_8859-2');
> @setlocale(LC_TIME, 'pl_PL');
> setlocale(LC_ALL, 'Polish_Poland.28592');
>  i wiele innych i nic
> Da rade coś z tym zrobić?

Coś popsułeś :-P

| #include <locale.h>
| #include <unistd.h>
| #include <sys/types.h>
| #include <stdio.h>
| #include <stdlib.h>
| #include <string.h>
| #include <time.h>
| 
| int main(int argc, char **argv)
| {
| 	time_t t = time(NULL);
| 	char tt[100];
| 	setlocale(LC_TIME, "pl_PL");
| 	strftime(tt, 98, "%c", localtime(&t));
| 	printf("%s\n", tt);
| }

porridge@melina11:~/tmp$ LANG=C LC_ALL=C ./a
wto 07 cze 2005 18:32:50 CEST


Marcin
-- 
Marcin Owsiany <porridge@debian.org>             http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216



Reply to: