[Developers] representation of date and time

Thomas Radke tradke at aei.mpg.de
Thu Jul 20 03:40:28 CDT 2006


Sorry if you get this email again. I accidentally sent it to Carpet 
developers yesterday but it should have gone out to Cactus developers.


Hi,

the flesh provides routines which return date/time information:

   Util_CurrentDate()
   Util_CurrentTime()
   CCTK_CompileDate()
   CCTK_CompileTime()

represented in the format "<Month> DD YYYY" for a date (where <Month> is
a 3-letter literal) and "HH:MM:SS" for time (no timezone information is
encoded).

I want to use these functions in the Announce interface, in order to tag
each announced item by a given datetime. One can then, for instance, ask
an information service which stores such announced Cactus data, to "list
all my simulations on peyote from last week".
However, this requires that the datetime information is easily
machine-processable, ie. follows a standard (in this case: ISO 8601). At
least the date format above is not compatible with this standard.

I suggest two things:

  * Add 2 new flesh functions to be used by the Announce routines

            char* Util_CurrentDateTime(void);
      const char* Util_CompileDateTime(void);

    which return a datetime string following ISO 8601. The first function
    returns a pointer to an allocated string which must be freed
    afterwards.

  * Add a timezone indicator for strings returned by Util_CurrentTime()
    and CCTK_CompileTime(). This would look like "13:55:13+0200" for my
    current timezone.

Comments ?

-- 
Cheers, Thomas.



More information about the Developers mailing list