PHP 日期函数 date_isodate_set()


PHP 日期函数 date_isodate_set()

<?php
   $dateSrc = '2005-04-19 12:50 GMT';
   $dateTime = date_create( $dateSrc);;

   # Now set a new date using date_isodate_set();
   date_isodate_set( $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->setISODate( 1999, 10, 12);

   echo "New Formatted date is ". $dateTime->format("Y-m-d\TH:i:s\Z");
?>