首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

IntlCalendar::getRepeatedWallTimeOption

(PHP 5.5.0, PHP 7, PECL >= 3.0.0a1)

IntlCalendar::getRepeatedWallTimeOption — Get behavior for handling repeating wall time

Description

Object oriented style

代码语言:javascript
复制
public int IntlCalendar::getRepeatedWallTimeOption ( void )

Procedural style

代码语言:javascript
复制
int intlcal_get_repeated_wall_time_option ( IntlCalendar $cal )

Gets the current strategy for dealing with wall times that are repeated whenever the clock is set back during dailight saving time end transitions. The default value is IntlCalendar::WALLTIME_LAST.

This function requires ICU 4.9 or later.

Parameters

cal

The IntlCalendar resource.

Return Values

One of the constants IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST.

Examples

Example #1 IntlCalendar::getRepeatedWallTimeOption()

代码语言:javascript
复制
<?php
ini_set('date.timezone',?'Europe/Lisbon');
ini_set('intl.default_locale',?'en_US');
ini_set('intl.error_level',?E_WARNING);

//On?October?27th?at?0200,?the?clock?goes?back?1?hour?and?from?GMT+01?to?GMT+00
$cal?=?new?IntlGregorianCalendar(2013,?9?/*?October?*/,?27,?1,?30);

var_dump($cal->getRepeatedWalltimeOption());?//?0?WALLTIME_LAST

$formatter?=?IntlDateFormatter::create(
????NULL,
????IntlDateFormatter::FULL,
????IntlDateFormatter::FULL,
????'UTC'
);
var_dump($formatter->format($cal->getTime()?/?1000.));

$cal->setRepeatedWalltimeOption(IntlCalendar::WALLTIME_FIRST);
var_dump($cal->getRepeatedWalltimeOption());?//?1?WALLTIME_FIRST
$cal->set(IntlCalendar::FIELD_HOUR_OF_DAY,?1);

var_dump($formatter->format($cal->getTime()?/?1000.));

The above example will output:

代码语言:javascript
复制
int(0)
string(42) "Sunday, October 27, 2013 at 1:30:00 AM GMT"
int(1)
string(43) "Sunday, October 27, 2013 at 12:30:00 AM GMT"

See Also

  • IntlCalendar::getSkippedWallTimeOption() - Get behavior for handling skipped wall time
  • IntlCalendar::setSkippedWallTimeOption() - Set behavior for handling skipped wall times at positive timezone offset transitions
  • IntlCalendar::setRepeatedWallTimeOption() - Set behavior for handling repeating wall times at negative timezone offset transitions

← IntlCalendar::getNow

IntlCalendar::getSkippedWallTimeOption →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com