DateTime object with timezone GMT+XX.XX

Bug #143070 reported by Amit Khan
2
Affects Status Importance Assigned to Milestone
DateTime
Invalid
Medium
Unassigned

Bug Description

DateTime() returns a wrong DateTime object when local time zone offset from GMT is not an integer. Like for a local time zone GMT+05.30, DateTime() object is returning an DateTime object where time zone offset is set to GMT+5 - this is resulting 30 minutes of difference when we are translating the current time to some other time zope.

It seems the problem is in constructor (init() method) of DateTime class.

The problem remains in 2.5+ versions as well like 2.6, 2.7 etc.
Best Regards
Amit

Tags: bug zope
Revision history for this message
Andreas Jung (ajung) wrote :

Changes: submitter email, importance (critical => medium)

Revision history for this message
Amit Khan (amit-khan) wrote :

When can we expect a patch for the same? Is there any work around we may use till the patch is available for it?

Best Regards
Amit Khan

Revision history for this message
Andreas Jung (ajung) wrote :

I just changed the importance because this issue is not critical and it does not mean that someone is assigned to handle this issue at this time...patches are welcome.

Revision history for this message
Lupa Zurven (yaybee) wrote :

Perhaps I am provincial, but in my part of the world there are no fractional time zones. I don't see a bug here. DateTime should only accept an int for an offset value because time zones come in full hours of offset, not fractional hours. I think it is nice (a feature, not a bug) that it accepts a float like 5.30 at all, and converts it to an int for the time zone conversion. I would consider helping on this one if I could see what the problem might be, but this behavior sounds exactly right to me. Amit, do you have more information about what you think the proper behavior should be?

Revision history for this message
Andreas Jung (ajung) wrote :

Please submit a patch if it is important for you but there is nothing about this problem that makes it "critical".

Revision history for this message
TinoW (tino-wildenhain) wrote :

Changes: edited transcript, new comment

India that is. See:
http://lists.gnu.org/archive/html/bug-cvs/2004-04/msg00320.html
there are other people biten by this :-)
Maybe the OP could provide a patch?

Revision history for this message
Andreas Jung (ajung) wrote :

What is the "OP"?

Revision history for this message
TinoW (tino-wildenhain) wrote :

amit? :-)

Revision history for this message
Lennart Regebro (regebro-gmail) wrote :

I think that this has nothing to do with fractionality, but timezone formatting. GMT+0530 works fine, GMT+05.00 does not.

This may indeed be a bug, but I agree it's minor. Both TZ GMT+0530 and Asia/Calcutta works fine for me.

Revision history for this message
Florent Guillaume (efge) wrote :

FYI: OP means Original Poster.

Revision history for this message
Florent Guillaume (efge) wrote :

Note that I can find no standard that allow GMT+05.30. Only GMT+0530 or GMT+05:30 are correct. Still, DateTime doesn't understant the latter. RFC2822 only allows +HHMM timezones.

See http://www.cl.cam.ac.uk/~mgk25/iso-time.html for an ISO 8601 reference.

affects: zope2 → datetime
Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

The single issue here is supporting the colon-separated notation (e.g. "GMT+05.30" or "+05:30"), the dot-separated notation "GMT+05.30" is not covered by any standard.

Unfortunately the code in DateTime.DateTime.DateTime._parse is a complete hairball.

Changed in datetime:
status: New → Confirmed
Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

Corrected comment:

The single issue here is supporting the colon-separated notation (e.g. "GMT+05:30" or "+05:30"), the dot-separated notation "GMT+05.30" is not covered by any standard.

Revision history for this message
Colin Watson (cjwatson) wrote :

The datetime project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/datetime.

Changed in datetime:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.