Date/Time 함수 목록
PHP Manual

date_create

(PHP 5 >= 5.2.0)

date_createReturns new DateTime object

설명

DateTime date_create ([ string $time= "now" [, DateTimeZone $timezone= NULL ]] )

인수

time

String in a format accepted by strtotime(), defaults to "now".

timezone

Time zone of the time.

반환값

Returns DateTime object on success or FALSE on failure.

예제

Example #1 date_create() example

<?php
date_default_timezone_set
('Europe/London');

$datetime date_create('2008-08-03 14:52:10');
echo 
date_format($datetimeDATE_ATOM);
?>

위 예제의 출력:

2008-08-03T14:52:10+01:00


Date/Time 함수 목록
PHP Manual