downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

DateTime::modify> <DateTime::getTimestamp
[edit] Last updated: Fri, 24 Jun 2011

view this page in

DateTime::getTimezone

(PHP 5 >= 5.2.0)

DateTime::getTimezoneبازگرداندن منطقه زمانی مرتبط با DateTime داده شده

Description

Oriented object style

public DateTimeZone DateTime::getTimezone ( void )

Procedural style

بازگرداندن منطقه زمانی مرتبط با DateTime داده شده.

Parameters

object

Procedural style only: A DateTime object returned by date_create()

Return Values

بازگرداندن شی DateTimeZone در صورت موفقیت or FALSE on failure.

Examples

Example #1 مثال DateTime::getTimezone()

Oriented object style

<?php
$date 
= new DateTime(null, new DateTimeZone('Europe/London'));
$tz $date->getTimezone();
echo 
$tz->getName();
?>

Procedural style

<?php
$date 
date_create(nulltimezone_open('Europe/London'));
$tz date_timezone_get($date);
echo 
timezone_name_get($tz);
?>

The above examples will output:

Europe/London

See Also



add a note add a note User Contributed Notes DateTime::getTimezone - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites