<?php
/* - - - - - - - - - - - - - - - - -
Object oriented style
- - - - - - - - - - - - - - - - - */
DateTime public DateTime::setDate ( int $year ,
int $month ,
int $day )
where,
$year = The year of the date
$month = The month of the date
$day = The day of the date
?>
<?php
/* - - - - - - - - - - - - - - - - -
Procedural style
- - - - - - - - - - - - - - - - - */
DateTime date_date_set ( DateTime $object ,
int $year ,
int $month ,
int $day )
where,
$object = A DateTime object
$year = The year of the date
$month = The month of the date
$day = The day of the date
?>
<?php
date_default_timezone_set('Asia/Tokyo');
$dttm001 = new DateTime();
$year = idate('Y');
$month = idate('m');
$day = idate('d');
$nwtm001 = $dttm001->setDate($year, $month, $day);
echo $dttm001->format(DATE_W3C);
?>
<?php
date_default_timezone_set('Asia/Tokyo');
$dttm002 = date_create();
$year = idate('Y');
$month = idate('m');
$day = idate('d');
$nwtm002 = date_date_set($dttm002, $year, $month, $day);
echo $dttm002->format('Y-m-d\TH:i:sP');
?>