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

 ID:                 53964
 Updated by:         johan...@php.net
 Reported by:        greg at pswdb dot com
 Summary:            minutes on date function incorrect; see examples
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            *General Issues
 Operating System:   fedora 13
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 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

Your format string includes "m" as in month twice. You need an "i" for
minutes.



date("Y-m-d h:i:s",$i);


Previous Comments:
------------------------------------------------------------------------
[2011-02-08 20:40:57] greg at pswdb dot com

Description:
------------
---

>From manual page: http://www.php.net/function.date

---

  $d="2010-01-31 09:06:09"; 

  $i= strtotime($d);    

  echo  '<br>' . $d  ; 

  echo  '<br>' . date("Y-m-d h:m:s",$i); 

produces this:

2010-01-31 09:06:09

2010-01-31 09:01:09





  $d="2011-01-20 09:48:00"; 

  $i= strtotime($d);    

  echo  '<br>' . $d  ; 

  echo  '<br>' . date("Y-m-d h:m:s",$i); 

produces this:

2011-01-20 09:48:00

2011-01-20 09:01:00





  $d="2010-06-26 01:29:39"; 

  $i= strtotime($d);    

  echo  '<br>' . $d  ; 

  echo  '<br>' . date("Y-m-d h:m:s",$i); 

produces this:

2010-06-26 01:29:39

2010-06-26 01:06:39 







Expected result:
----------------
2010-01-31 09:06:09

2010-01-31 09:06:09



2011-01-20 09:48:00

2011-01-20 09:48:00



2010-06-26 01:29:39

2010-06-26 01:29:39













Actual result:
--------------




2010-01-31 09:06:09

2010-01-31 09:01:09



2011-01-20 09:48:00

2011-01-20 09:01:00



2010-06-26 01:29:39

2010-06-26 01:06:39








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



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

Reply via email to