[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Dato og tid-format



$ cat tid.c
#include <stdio.h>
#include <time.h>
#include <locale.h>

int main()
{
  char buf[60];
  time_t tid = time (NULL);
  struct tm *lokaltid = localtime (&tid);

  setlocale (LC_TIME, "");
  printf ("LC_TIME er %s\n", setlocale (LC_TIME, NULL));

  strftime (buf, sizeof (buf), "%x", lokaltid);
  printf ("Foretrukket datoformat (%%x): %s\n", buf);

  strftime (buf, sizeof (buf), "%X", lokaltid);
  printf ("Foretrukket tidformat (%%X): %s\n", buf);

  strftime (buf, sizeof (buf), "%c", lokaltid);
  printf ("Foretrukket dato og tid-format (%%c): %s\n", buf);

  return 0;
}
$ gcc -o tid tid.c
$ ./tid
LC_TIME er da_DK
Foretrukket datoformat (%x): 13-09-2000
Foretrukket tidformat (%X): 12:01:26
Foretrukket dato og tid-format (%c): ons 13 sep 2000 12:01:26 CEST
$ 

Hvad synes I om disse danske tidsformater?

Jeg havde foretrukket f.eks.:
2000-09-13 (eller evt. 9.13.2000 eller 9/13-2000)
12.01.26
ons. d. 13. sep. 2000 kl. 12.01.26 CEST

-- 
Byrial
http://home.worldonline.dk/~byrial/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:52 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *