On Wed, Nov 3, 2010 at 10:44 AM, Peter Bex <peter....@xs4all.nl> wrote: >> 1) Using posix: >> >> (use posix) >> (time->string (string->time "2" "%d")) >> "Tue Jan 2 00:00:00 1900" >> >> but, my current locale es: >> >> (use locale) >> (current-locale) >> "es_AR.utf8" > > hmmm, I think time->string uses strftime(), so it depends on > whether your OS supports this. Can you verify that? (ie, what's > the output of date(2)?)
I think that is supported, I already wrote an C code to test it: #include <stdio.h> #include <time.h> #include <locale.h> int main() { time_t tiempo; char cad[80]; char *old_locale; struct tm *tmPtr; setlocale(LC_ALL, "es_AR.utf8"); tiempo = time(NULL); tmPtr = localtime(&tiempo); strftime(cad, 80, "%H:%M.%S, %A de %B de %Y", tmPtr); printf("%s\n", cad); return 0; } "11:30.08, miércoles de noviembre de 2010" (But sorry, I don't understand what is date(2), C, scheme, in the term?) > I guess it uses the more Schemely syntax from SRFI-19. See the SRFI > document for details: http://srfi.schemers.org/srfi-19/srfi-19.html > > (search for "string->date") > Great! it works!. Thanks, Hugo. _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users