Zope: I get a date from a MySQL DB in the format M/DD/YYYY HH:MM:SS AM (or PM). I need to check this date agains the current date. Can I request the Date in this specific format from Zope PythonScript? Thanks, Jason.
On Thursday 22 April 2004 04:39 pm, Jason C. Leach wrote:
Zope:
I get a date from a MySQL DB in the format M/DD/YYYY HH:MM:SS AM (or PM). I need to check this date agains the current date. Can I request the Date in this specific format from Zope PythonScript?
Yes, just call DateTime(date) or context.ZopeTime(date) where date is the string containing the date in the MySQL format. That will give you a Zope DateTime object for comparison. Alec Mitchell
You use DateTime() to create a date object: onedate =DateTime('09/21/2003 10:32:28 PM') rightnow = DateTime() # or context.ZopeTime() Now you have two objects to compare with Zope's DateTime methods. Ausum ----- Original Message ----- From: "Jason C. Leach" <jleach@ocis.net> To: <zope@zope.org> Sent: Thursday, April 22, 2004 6:39 PM Subject: [Zope] PythonScript DateTime() comparison.
Zope:
I get a date from a MySQL DB in the format M/DD/YYYY HH:MM:SS AM (or PM). I need to check this date agains the current date. Can I request the Date in this specific format from Zope PythonScript?
Thanks, Jason.
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Alec Mitchell -
Ausum Studio -
Jason C. Leach