ICanBoogie/DateTime 2.0.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • DateTime

Classes

  • DateTimeLocalizer
  • ImmutableDateTime
  • MutableDateTime
  • TimeZone
  • TimeZoneLocation

Interfaces

  • DateTime

Class TimeZone

Representation of a timezone.

<?php

use ICanBoogie\TimeZone;

$zone = new TimeZone('Europe/Paris');

echo $zone;                     // "Europe/Paris"
echo $zone->offset;             // 3600
echo $zone->location;           // FR,48.86667,2.33333
echo $zone->location->latitude; // 48.86667
echo $zone->is_utc;             // false
echo $zone->is_local;           // true
DateTimeZone
Extended by ICanBoogie\TimeZone
Namespace: ICanBoogie
Located at TimeZone.php

Methods summary

public static ICanBoogie\TimeZone
# from( mixed $source )

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\TimeZone
public
# __construct( string $timezone )

Initializes the $name property.

Initializes the $name property.

Parameters

$timezone

Overrides

DateTimeZone::__construct
public
# __get( $property )

Throws

LogicException
in attempt to get an undefined property.

Inheritdoc

public
# __set( $property, $value )

Throws

LogicException
in attempt to write any property.

Inheritdoc

protected ICanBoogie\TimeZoneLocation
# get_location( )

Returns

ICanBoogie\TimeZoneLocation
protected string
# get_name( )

Returns

string
protected integer
# get_offset( )

Returns

integer
protected boolean
# get_is_utc( )

Returns

boolean
true if time zone is UTC, false otherwise.
protected boolean
# get_is_local( )

Returns

boolean
true if time zone is local, false otherwise.
public string
# __toString( )

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 ICanBoogie\TimeZoneLocation $location

Location information for the timezone.

public read-only string $name

Name of the timezone.

public read-only integer $offset

Timezone offset from UTC.

public read-only boolean $is_utc

true Time zone is UTC, false otherwise.

public read-only boolean $is_local

true if time zone is local, false otherwise.

ICanBoogie/DateTime 2.0.x API documentation generated by ApiGen