Ticket #775 (closed defect: fixed)

Opened 4 months ago

Last modified 3 months ago

QDateTime constructor buggy

Reported by: vakopian Owned by:
Priority: shipstopper Milestone: 2.1
Component: Framework Version: 2.0.2 Stable
Keywords: Cc:

Description

As discussed in  http://qcu.be/content/qdatetime-timezone-issue

	$strTime = '2005-05-05T11:05:24+0700';
	print $strTime."\n";
	// show that DateTime handles everything correctly
	$y = new Datetime($strTime);
	print $y->format(DateTime::ISO8601)." - DateTime\n";
	// and QDateTime fails miserably
	$x = new QDatetime($strTime);
	print $x->format(DateTime::ISO8601)." - QDateTime\n";

This produces
<code>
2005-05-05T11:05:24+0700
2005-05-05T11:05:24+0700 - DateTime?
2005-05-04T21:05:24-0700 - QDateTime
</code>

Attachments

ticket775.patch Download (1.2 KB) - added by vakopian 4 months ago.

Change History

Changed 4 months ago by vakopian

Well, I still don't understand what is it that QDateTime tries to handle in that horrible block (lines 163-190), and I still don't know what's this mysterious comment referring to on line 178:

// To deal with "Tues" and date skipping bug in PHP 5.2

But I think I have a fix for the bug above.
Please test/review.

Changed 4 months ago by vakopian

Changed 3 months ago by vakopian

  • status changed from new to in_QA

Changed 3 months ago by vakopian

  • status changed from in_QA to closed
  • resolution set to fixed

(In [1417]) Fixes #775

Note: See TracTickets for help on using tickets.