note 102344 deleted from function.date by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: guiwoda 

----

Quote:
------
<?php 
$d="2010-01-31 09:06:09"; 
$i= strtotime($d);    
echo $d; 
echo "<br>"; 
echo date("Y-m-d h:m:s",$i); 
?> 

this gives the output: 

2010-01-31 09:06:09 
2010-01-31 09:01:09 

very small change but still not accurate.
------

This is not true. The date function is accurate.
The error lies in the format string:
'Y-m-d h:m:s' will give Year Month Day Hours Month Second.

The correct way of doing it would be:
date('Y-m-d H:i:s', $i);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.