php[world] 2015 Call for Speakers

La classe DateTimeZone

(PHP 5 >= 5.2.0)

Introduction

Représentation d'un fuseau horaire.

Synopsis de la classe

DateTimeZone {
/* Constantes */
const integer AFRICA = 1 ;
const integer AMERICA = 2 ;
const integer ANTARCTICA = 4 ;
const integer ARCTIC = 8 ;
const integer ASIA = 16 ;
const integer ATLANTIC = 32 ;
const integer AUSTRALIA = 64 ;
const integer EUROPE = 128 ;
const integer INDIAN = 256 ;
const integer PACIFIC = 512 ;
const integer UTC = 1024 ;
const integer ALL = 2047 ;
const integer ALL_WITH_BC = 4095 ;
const integer PER_COUNTRY = 4096 ;
/* Méthodes */
public __construct ( string $timezone )
public array getLocation ( void )
public string getName ( void )
public int getOffset ( DateTime $datetime )
public array getTransitions ([ int $timestamp_begin [, int $timestamp_end ]] )
public static array listAbbreviations ( void )
public static array listIdentifiers ([ int $what = DateTimeZone::ALL [, string $country = NULL ]] )
}

Constantes pré-définies

DateTimeZone::AFRICA

Fuseau africain.

DateTimeZone::AMERICA

Fuseau américain.

DateTimeZone::ANTARCTICA

Fuseau antarctique.

DateTimeZone::ARCTIC

Fuseau arctique.

DateTimeZone::ASIA

Fuseau asiatique.

DateTimeZone::ATLANTIC

Fuseau atlantique.

DateTimeZone::AUSTRALIA

Fuseau australien.

DateTimeZone::EUROPE

Fuseau européen.

DateTimeZone::INDIAN

Fuseau indien.

DateTimeZone::PACIFIC

Fuseau pacifique.

DateTimeZone::UTC

Fuseau UTC.

DateTimeZone::ALL

Tous les fuseaux.

DateTimeZone::ALL_WITH_BC

Tous les fuseaux, y compris les anciens.

DateTimeZone::PER_COUNTRY

Fuseaux horaires par pays.

Sommaire

add a note add a note

User Contributed Notes 1 note

up
0
Anonymous
1 hour ago
strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /

I added this but it's still not working:
date_default_timezone_set('London');                                     DateTimeZone::EUROPE;
To Top