[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
 

Re: [CPROG] Date/time funktioner



Søren H. Sørensen wrote:
> 
> Lige en velment advarsel. Både "strfrime" og også "localtime" (som godt
> nok bruges på en helt anden måde) giver at året lige nu er 101, og ikke
> bare 1. Jeg måtte droppe strftime for nylig og bruge localtime for at
> kunne rette i årstallet.

Så vidt jeg husker er vi da i år 2001 og intet andet!
Befri os for 1,2 (eller 3??) cifrede årstal.

> > strftime(timestring, 20, "%Y-%m-%d %k:%M:%S", gmtime(&timestamp));

Virker perfekt og minder vist meget og international (ISO 8601)
dato/tids format :-) (%k er dog ikke med i ISO-C, så det vil nok være
mere korrekt an anvende %H)
Ifølge manualen for strftime() og ifølge ISO-C, giver %y to-cifrede
årstal (%Y giver 4 cifre).
Skulle dit bibliotek have en fejl på det punkt, så er det altså en
afvigelse fra både manualen og ISO-C!

/Egon


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 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] *