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

search for in the

DateTime::modify> <DateTime::getTimestamp
[edit] Last updated: Sat, 07 Jan 2012

view this page in

DateTime::getTimezone

date_timezone_get

(PHP 5 >= 5.2.0)

DateTime::getTimezone -- date_timezone_getReturn time zone relative to given DateTime

설명

객체 기반 형식

public DateTimeZone DateTime::getTimezone ( void )

절차식 형식

Return time zone relative to given DateTime.

인수

object

절차식 전용: date_create()가 반환하는 DateTime 객체.

반환값

Returns a DateTimeZone object on success or FALSE on failure.

예제

Example #1 DateTime::getTimezone() example

객체 기반 형식

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

절차식 형식

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

위 예제들의 출력:

Europe/London

참고



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

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