[Zope] Manipulating dates

Corey Ralph corey@net-tech.com.au
Wed, 9 Jun 1999 16:30:09 +1000


This is probably more of a MySQL question than a zope question, but I figured
someone here would have dealt with it before.  A couple things I need to do with
dates, I'm not sure what the best approach would be:

1. Convert dates to/from mysql (yyyy-mm-dd) to normal format (dd/mm/yyyy)
2. Subtract dates to get the interval in hh:mm:ss format.  I have done this in
mysql by converting them to timestamps, then subtracting one from the other,
then converting this to a time:
select SEC_TO_TIME(UNIX_TIMESTAMP(EndTime)-UNIX_TIMESTAMP(StartTime)) ...
Except once I put this function into a Z SQL Method, it doesn't work.  Surely
there is a better way anyway.

Would I be better off doing them in DTML or in the SQL?

Any ideas appreciated.

Cheers,
Corey