PYTHON date_create

(0)
Python replacement for PHP's date_create [ edit ]



Do you know a Python replacement for PHP's date_create ? Write it!

PHP date_create

PHP original manual for date_create [ show | php.net ]

date_create

(PHP 5 >= 5.2.0)

date_createReturns new DateTime object

Description

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

Parameters

time

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

timezone

Time zone of the time.

Return Values

Returns DateTime object on success or FALSE on failure.

Examples

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);
?>

The above example will output:

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