Changeset 2808 in Sophya for trunk/SophyaLib/NTools/datime.h
- Timestamp:
- Jun 14, 2005, 1:25:05 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/datime.h
r220 r2808 10 10 11 11 12 /*! 13 \ingroup NTools 14 \file datime.h 15 Set of C functions and macros to manipulate date and time + Sidereal time. 16 \sa datime.c 17 \warning : If possible, use class SOPHYA::TimeStamp 18 */ 19 /*! 20 \ingroup NTools 21 \brief Structure JMA pour representer une date (Jour, Mois Annee) */ 12 22 typedef struct 13 23 { … … 17 27 } JMA ; 18 28 19 29 /*! 30 \ingroup NTools 31 \brief Structure HMS pour representer une heure (Heure, Minute Seconde) 32 */ 20 33 typedef struct 21 34 { … … 25 38 } HMS ; 26 39 40 /* \cond 27 41 /* ---------- 2) Donnees constantes ---------- */ 28 42 #ifdef DATIMEPRIVEE … … 43 57 #endif 44 58 59 /* \endcond */ 45 60 /* ------ 3) Macro de manipulation de date et heure ------- */ 46 47 61 #define NomJour(d) (NomJo[NumJour(d)-1]) 48 62 #define NomMois(d) (NomMo[d.Mois-1]) 49 63 50 /* Chaine de forme hh:mm:sec <-> structure HMS */ 64 /* Chaine de forme hh:mm:sec <-> structure HMS */ 65 /*! \brief Decodage de Chaine de forme hh:mm:sec -> structure HMS */ 51 66 #define StrgtoHMS(s,h) ( sscanf(s,"%d:%d:%lf", &(h.Heures),&(h.Minutes),&(h.Secondes)) ) 67 /*! \brief structure HMS -> Chaine de forme hh:mm:sec */ 52 68 #define HMStoStrg(h,s) ( sprintf(s,"%02d:%02d:%02.0f", h.Heures,h.Minutes,h.Secondes) ) 53 69 … … 55 71 /* EA 140998, machin infame pour que ca marche pour 1998/09/14... Pourquoi avoir fait */ 56 72 /* des macros ??????????????????????????????????????????????????????????????????????? */ 73 /*! \brief Chaine de caracteres sous forme de dd/mm/aaaa -> structure JMA jma. */ 57 74 #define StrgtoJMA(strg,j) ( sscanf(strg,"%d/%d/%d", &(j.Jour),&(j.Mois),&(j.Annee)),\ 58 75 (j.Jour>1900 ? sscanf(strg,"%d/%d/%d", &(j.Annee),&(j.Mois),&(j.Jour)) : 1) ) 59 76 /*! \brief structure JMA -> Chaine de forme jj/mm/aa */ 60 77 #define JMAtoStrg(j,strg) ( sprintf(strg,"%02d/%02d/%4d", j.Jour,j.Mois,j.Annee) ) 78 /*! \brief structure JMA -> Chaine de forme jj/mm/aa */ 61 79 #define JMAtoStrgLong(j,strg) ( sprintf(strg,"%s , %d %s %d", NomJo[NumJour(j)-1], j.Jour, NomMo[j.Mois-1], j.Annee) ) 62 80
Note:
See TracChangeset
for help on using the changeset viewer.