Class TimeZone
Representation of a timezone.
<?php
use ICanBoogie\TimeZone;
$zone = new TimeZone('Europe/Paris');
echo $zone;
echo $zone->offset;
echo $zone->location;
echo $zone->location->latitude;
-
DateTimeZone
-
┗
ICanBoogie\TimeZone
Methods summary
public static
from( mixed $source )
: ICanBoogie\Time\Zone
Returns a timezone according to the specified source.
Returns a timezone according to the specified source.
If the source is already an instance of Zone, it is returned as is.
Note: Instances created by the method are shared. That is, equivalent sources yield
the same instance.
Parameters
$source
- Source of the timezone.
Returns
ICanBoogie\Time\Zone
public
__construct( string $timezone )
Initializes the $name property.
Initializes the $name property.
Parameters
Overrides
DateTimeZone::__construct
public
__get( $property )
Returns the $location, $name and $offset properties.
Returns the $location, $name and $offset properties.
Throws
PropertyNotDefined
in attempt to get an unsupported property.
public
__toString( void )
: string
Returns the name of the timezone.
Returns the name of the timezone.
Returns
string
Methods inherited from DateTimeZone
__set_state(),
__wakeup(),
getLocation(),
getName(),
getOffset(),
getTransitions(),
listAbbreviations(),
listIdentifiers()
Constants summary
Constants inherited from DateTimeZone
AFRICA,
ALL,
ALL_WITH_BC,
AMERICA,
ANTARCTICA,
ARCTIC,
ASIA,
ATLANTIC,
AUSTRALIA,
EUROPE,
INDIAN,
PACIFIC,
PER_COUNTRY,
UTC
Properties summary
Magic properties
public read-only
$name
: string
public read-only
$offset
: integer
Timezone offset from UTC.