[ZCM] [ZC] 778/ 1 Request "DateTime() return wrong object"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Sun, 19 Jan 2003 21:27:02 -0500


Issue #778 Update (Request) "DateTime() return wrong object"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/778

==============================================================
= Request - Entry #1 by Anonymous User on Jan 19, 2003 9:26 pm

This is an interesting bug because it can only be reproduced with the following set of commands in a python script.

 dummy_date = DateTime('2002-01-01')
 print dummy_date.day()
 print dummy_date.timeTime()
 test_date = DateTime(dummy_date.timeTime())
 print test_date.day()
 print test_date.timeTime()
 return printed

If you do this you will notice two different dates returned with the same timeTime() value. This will happen anytime you define a DateTime object without a time.

I have managed to work around this in my scripts by adding a time to the DateTime declaration:

 dummy_date = DateTime('2002-01-01 00:00:01')

When you do this the problem goes away.
==============================================================