91亚洲精品福利在线播放,欧美日韩国产在线人成app,天天躁日日躁疯人影院,sao虎视频最新网站入口,精品久久久久久中文字幕女

DateTime::getTimezone

DateTimeImmutable::getTimezone

DateTimeInterface::getTimezone

date_timezone_get

(PHP 5 >= 5.2.1, PHP 7, PHP 8)

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

說(shuō)明

面向對象風(fēng)格

public DateTime::getTimezone(): DateTimeZone|false
public DateTimeImmutable::getTimezone(): DateTimeZone|false
public DateTimeInterface::getTimezone(): DateTimeZone|false

過(guò)程化風(fēng)格

Return time zone relative to given DateTime.

參數

object

僅為過(guò)程化風(fēng)格:由 date_create() 返回的 DateTime 類(lèi)型的對象。

返回值

Returns a DateTimeZone object on success 或者在失敗時(shí)返回 false.

范例

示例 #1 DateTime::getTimezone() example

面向對象風(fēng)格

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

過(guò)程化風(fēng)格

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

以上例程會(huì )輸出:

Europe/London

參見(jiàn)

91亚洲精品福利在线播放,欧美日韩国产在线人成app,天天躁日日躁疯人影院,sao虎视频最新网站入口,精品久久久久久中文字幕女