No cache version.


Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

IntlCalendar: : getSkippedWallTimeOption

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

IntlCalendar::getSkippedWallTimeOptionGet behavior for handling skipped wall time

Description

Object oriented style

public IntlCalendar::getSkippedWallTimeOption ( void ) : int

Procedural style

intlcal_get_skipped_wall_time_option ( IntlCalendar $cal ) : int

Gets the current strategy for dealing with wall times that are skipped whenever the clock is forwarded during dailight saving time start transitions. The default value is IntlCalendar::WALLTIME_LAST.

The calendar must be lenient for this option to have any effect, otherwise attempting to set a non-existing time will cause an error.

This function requires ICU 4.9 or later.

PHP: IntlCalendar::getSkippedWallTimeOption - Manual Home of Manuel PHP  Contents Haut

Return Values

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

PHP: IntlCalendar::getSkippedWallTimeOption - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 IntlCalendar::getSkippedWallTimeOption()

<?php
ini_set
('date.timezone''Europe/Lisbon');
ini_set('intl.default_locale''en_US');
ini_set('intl.error_level'E_WARNING);

//On March 31st at 0100, the clock goes forward 1 hour and from GMT+00 to GMT+01
$cal = new IntlGregorianCalendar(2013/* March */31130);

var_dump(
    
$cal->isLenient(),               // true
    
$cal->getSkippedWalltimeOption() // 0 WALLTIME_LAST
);

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

$cal->setSkippedWallTimeOption(IntlCalendar::WALLTIME_FIRST);
var_dump($cal->getSkippedWalltimeOption()); // 1 WALLTIME_FIRST
$cal->set(IntlCalendar::FIELD_HOUR_OF_DAY1);

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

$cal->setSkippedWallTimeOption(IntlCalendar::WALLTIME_NEXT_VALID);
var_dump($cal->getSkippedWalltimeOption()); // 2 WALLTIME_NEXT_VALID
$cal->set(IntlCalendar::FIELD_HOUR_OF_DAY1);

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

The above example will output:

bool(true)
int(0)
string(40) "Sunday, March 31, 2013 at 1:30:00 AM GMT"
int(1)
string(41) "Sunday, March 31, 2013 at 12:30:00 AM GMT"
int(2)
string(40) "Sunday, March 31, 2013 at 1:00:00 AM GMT"

PHP: IntlCalendar::getSkippedWallTimeOption - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-intlcalendar.getskippedwalltimeoption.html/.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut