[JDEV] Timestamp format (summary)

Waleed Abdulla WaleedKA at emirates.net.ae
Mon Oct 11 02:46:32 CDT 1999


I summarized all the previous discussions about the format of the timestamp.
I hope this will help everyone get a better idea.

Three formats were mentioned (ISO, RFC, and time_t). Below are the
properties of each of them:

1. ISO 8601  = yyyymmddThh:mm:ss
   a. compact
   b. human readable (easy to debug using a text editor)
   c. Y2K compliant
   d. Used in XML RPC to pass date-time parameters
   e. Easy to sort on
   f. Easy to parse

2. RFC 822 = DD MMM YYYY hh:mm:ss zone
   a. used in SMTP
   b. Human readable (easy to debug using a text editor)
   c. Difficult to parse
   d. Can't sort on it
   e. Consumes extra bytes
   f. Previously caused problems in some SMTP clients

3. time_t (Number of seconds since 1970)
   a. Supported by some programming languages (such as C/C++)
   b. Not human readable (can't debug using a text editor)
   c. Difficult to parse (if your programming language
      doesn't support it)
   d. Easy to sort on
   e. Y2K compliant
   f. compact
   g. Y2038 problem (converting to 64 bit will solve this problem)


I see that the majority is going with the ISO format. This is my preference
also.

Waleed






More information about the JDev mailing list