Forum OpenACS Development: Response to Date formats in OpenACS

Collapse
Posted by carl garland on

Just as a clarification the reason I recommended storing dates in integer (which is possible in PG using abstime and selecting using a cast ... even faster really since it doesn't have to convert to string) was for 2 reasons:

  • Speed ... see above
  • If you also have the users timezone stored as integer offset you can easily convert timestamps by simple addition and then apply whatever formatting the user prefers with the ns_fmttime call.
There are drawbacks to this approach most notably the range of legal times available. I do concede that this probably isn't the best implementation for OpenACS but still works and well for me.

Best Regards, Carl