PHP 日期函数 date_format()
PHP 日期函数 date_format()
<?php
$dateSrc = '2005-04-19 12:50 GMT';
$dateTime = date_create( $dateSrc);;
# Now set a new date using date_format();
date_format( $dateTime, 2000, 12, 12);
echo "New Formatted date is ". $dateTime->format("Y-m-d\TH:i:s\Z");
echo "<br />";
# Using second function.
$dateTime = new DateTime($dateSrc);
$dateTime->setDate( 1999, 10, 12);
echo "New Formatted date is ". $dateTime->format("Y-m-d\TH:i:s\Z");
?>