Edit report at http://bugs.php.net/bug.php?id=52123&edit=1

 ID:               52123
 Updated by:       [email protected]
 Reported by:      alipendashteh at gmail dot com
 Summary:          strtotim() returns date for one year ago
-Status:           Open
+Status:           Bogus
 Type:             Bug
-Package:          *Data Exchange functions
+Package:          Date/time related
 Operating System: Windows
 PHP Version:      5.3.2

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is not a bug. 2011 is seen as time instead:



php -r 'var_dump(date_parse("2011, February 8"));'

array(12) {

  ["year"]=>

  bool(false)

  ["month"]=>

  int(2)

  ["day"]=>

  int(8)

  ["hour"]=>

  int(20)

  ["minute"]=>

  int(11)

  ["second"]=>

  int(0)

  ["fraction"]=>

  bool(false)

  ["warning_count"]=>

  int(0)

  ["warnings"]=>

  array(0) {

  }

  ["error_count"]=>

  int(0)

  ["errors"]=>

  array(0) {

  }

  ["is_localtime"]=>

  bool(false)

}


Previous Comments:
------------------------------------------------------------------------
[2010-06-19 11:22:14] alipendashteh at gmail dot com

Description:
------------
Hi,

strtotime returns wrong date (one year ago) with some formats like:

2011, February 8



Test script:
---------------
echo (date('Y-m-d', strtotime("2011, February 8")));

Expected result:
----------------
2011-02-08

Actual result:
--------------
2010-02-08


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52123&edit=1

Reply via email to