ICanBoogie/DateTime v1.2.0
  • Namespace
  • Class

Namespaces

  • ICanBoogie

Classes

  • DateTime
  • TimeZone
  • TimeZoneLocation

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
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 )

Returns the $location, $name and $offset properties.

Returns the $location, $name and $offset properties.

Throws

PropertyNotDefined
in attempt to get an unsupported property.
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.

ICanBoogie/DateTime v1.2.0 API documentation generated by ApiGen