|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-03 06:00 UTC] mj@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 04:00:02 2025 UTC |
require_once 'Date/Date.php'; $date = new Date(time()); echo $date->format('%A %e of %B, %Y [%R %Z]'),"\n"; $date->convertTZbyID('US/Eastern'); echo $date->format('%A %e of %B, %Y [%R %Z]'),"\n"; produces: Wednesday 1 of January, 2003 [18:39 PST] Wednesday 01 of , 2003 [21:39 EST] This patch will fix it: Index: Date.php =================================================================== RCS file: /repository/pear/Date/Date.php,v retrieving revision 1.7 diff -u -r1.7 Date.php --- Date.php 12 Nov 2002 18:11:10 -0000 1.7 +++ Date.php 2 Jan 2003 02:41:32 -0000 @@ -532,6 +532,9 @@ list($this->year, $this->month, $this->day) = sscanf(Date_Calc::daysToDate($d), "%04s%02s%02s"); + $this->year = intval($this->year); + $this->month = intval($this->month); + $this->day = intval($this->day); } /** @@ -580,6 +583,9 @@ list($this->year, $this->month, $this->day) = sscanf(Date_Calc::daysToDate($d), "%04s%02s%02s"); + $this->year = intval($this->year); + $this->month = intval($this->month); + $this->day = intval($this->day); } /**