Home » Date and Time » Date » Bug #3846
getYear and GetMonth incorrectly return a string
Details
| Submitted | 2005-03-16 17:13 UTC |
|---|---|
| From | nick at silverorange dot com |
| Assigned | pajoye |
| Status | Closed |
| Package | Date |
| PHP Version | 5.0.3 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-03-16 17:13 UTC] nick at silverorange dot com
Description:
------------
Comments for getMonth and getYear state the return value as int, but getMonth returns '01' for January.
Reproduce code:
---------------
Index: Date.php
===================================================================
RCS file: /repository/pear/Date/Date.php,v
retrieving revision 1.29
diff -u -r1.29 Date.php
--- Date.php 5 Jan 2005 20:20:56 -0000 1.29
+++ Date.php 16 Mar 2005 17:05:13 -0000
@@ -1057,7 +1076,7 @@
*/
function getYear()
{
- return $this->year;
+ return (int)$this->year;
}
/**
@@ -1070,7 +1089,7 @@
*/
function getMonth()
{
- return $this->month;
+ return (int)$this->month;
}
/**
Expected result:
----------------
values returned as int