Freelance PHP programmer India | Freelance web developer india | Web development India | web developer CV india | Compiling PHP and Apache 2 from source on Linux
DateTime
PHP Manual

DateTime::__construct

(No version information available, might be only in CVS)

DateTime::__constructReturns new DateTime object

Description

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

Returns new DateTime object.

Parameters

time

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

timezone

Time zone of the time.

Errors/Exceptions

Emits Exception in case of an error.

Examples

Example #1 DateTime::__construct() example

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

$datetime = new DateTime('2008-08-03 14:52:10');
echo 
$datetime->format(DATE_ATOM);
?>


DateTime
PHP Manual