note 33311 deleted from function.date by philip
| From: | philip@php.net | Date: | Sat, 02 Aug 2003 15:23:23 +0000 |
| Subject: | note 33311 deleted from function.date by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53205@lists.php.net to get a copy of this message | ||
Note Submitter: lista@zepelim.com.br
----
this function may change the server time to the time zone that you need
<?
function dateI($format){
$dateParts =
array("Y","m","d","H","i","s");
$now = date("Y-m-d-H-i-s",time()+7200);
$timeParts = split("-",$now);
for($i=0;$i <= 6;$i++){
$format = str_replace($dateParts[$i],$timeParts[$i],$format);
}
return $format;
}
//EX:
echo dateI("Ymd")."<BR>";
echo dateI("Ymd")."<BR>";
echo dateI("d/m/Y H:i:s")."<BR>";
?>