Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

datime.c

Go to the documentation of this file.
00001 /*
00002  * $Id: datime.c,v 1.2 2009/02/16 08:04:36 schubert Exp $
00003  *
00004  * Revision 1.1.1.1  2002/06/16 15:18:46  hristov
00005  * Separate distribution  of Geant3
00006  *
00007  * Revision 1.1.1.1  1999/05/18 15:55:28  fca
00008  * AliRoot sources
00009  *
00010  * Revision 1.5  1997/12/19 16:36:06  mclareni
00011  * After 2000, the date in ID, ND will have the old format with the year as 2 digits
00012  *
00013  * Revision 1.4  1997/12/15 16:52:27  mclareni
00014  * Make length of structure slate 40, same as common slate in all the other routines
00015  *
00016  * Revision 1.3  1997/09/02 14:26:35  mclareni
00017  * WINNT correction
00018  *
00019  * Revision 1.2  1997/02/04 17:34:15  mclareni
00020  * Merge Winnt and 97a versions
00021  *
00022  * Revision 1.1.1.1.2.1  1997/01/21 11:29:24  mclareni
00023  * All mods for Winnt 96a on winnt branch
00024  *
00025  * Revision 1.1.1.1  1996/02/15 17:49:21  mclareni
00026  * Kernlib
00027  * 
00028  */ 
00029 #include "kerngen/pilot.h"
00030 #include "kerngen/fortranc.h"
00031 
00032 #if defined(CERNLIB_QMIRTD)
00033 #include "irtdgs/datime.c"
00034 #else
00035 /*>    ROUTINE DATIME
00036   CERN PROGLIB# Z007    DATIME          .VERSION KERNFOR  4.40  940929
00037 */
00038 #if !defined(CERNLIB_QMOS9)
00039 #include <sys/types.h>
00040 #endif
00041 #include <time.h>
00042 
00043 #if defined(CERNLIB_QX_SC)
00044 #define slate slate_
00045 struct { int  inum[40]; } slate_;
00046 void type_of_call datime_(id, it)
00047 #endif
00048 #if defined(CERNLIB_QXNO_SC)
00049 struct { int  inum[40]; } slate;
00050 void type_of_call datime(id, it)
00051 #endif
00052 #if defined(CERNLIB_QXCAPT)
00053 #define slate SLATE
00054 struct { int  inum[40]; } SLATE;
00055 void type_of_call DATIME(id, it)
00056 #endif
00057    int  *id, *it;
00058 {
00059       struct tm *tp;
00060 #if defined(CERNLIB_QMAPO)
00061       int   nsl;
00062 #endif
00063 
00064 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QX_SC))
00065       void  type_of_call toslat_();
00066 #endif
00067 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QXNO_SC))
00068       void  type_of_call toslat();
00069 #endif
00070 
00071 #if defined(CERNLIB_QXCAPT)
00072       void  type_of_call TOSLAT();
00073 #endif
00074 
00075    time_t tloc = time(0);
00076    tp = localtime(&tloc);
00077    slate.inum[0] = tp->tm_year + 1900;
00078    slate.inum[1] = tp->tm_mon + 1;
00079    slate.inum[2] = tp->tm_mday;
00080    slate.inum[3] = tp->tm_hour;
00081    slate.inum[4] = tp->tm_min;
00082    slate.inum[5] = tp->tm_sec;
00083 #if defined(CERNLIB_QMAPO)
00084       nsl = 6;
00085 #endif
00086 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QX_SC))
00087       toslat_ (slate.inum, &nsl);
00088 #endif
00089 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QXNO_SC))
00090       toslat (slate.inum, &nsl);
00091 #endif
00092    *id  = (tp->tm_year % 100 ) * 10000;
00093    *id += (tp->tm_mon + 1) * 100;
00094    *id += tp->tm_mday;
00095    *it  = tp->tm_hour * 100;
00096    *it += tp->tm_min;
00097    return;
00098 }
00099 /*> END <----------------------------------------------------------*/
00100 #endif

Generated on Mon Feb 15 11:06:34 2010 for loon by  doxygen 1.3.9.1