ICanBoogie/DateTime 2.0.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • DateTime

Classes

  • DateTimeLocalizer
  • ImmutableDateTime
  • MutableDateTime
  • TimeZone
  • TimeZoneLocation

Interfaces

  • DateTime

Class TimeZoneLocation

Representation of a time zone location.

<?php

use ICanBoogie\TimeZoneLocation;

$zone = new \DateTimeZone('Europe/Paris');
$location = new TimeZoneLocation($zone->getLocation());

echo $location;               // FR,48.86667,2.33333
echo $location->country_code; // FR
echo $location->latitude;     // 48.86667
echo $location->longitude;    // 2.33333

$location->latitude = true;   // throws ICanBoogie\PropertyNotWritable
Namespace: ICanBoogie
Located at TimeZoneLocation.php

Methods summary

public static ICanBoogie\TimeZoneLocation
# from( DateTimeZone $zone )

Creates an instance from a \DateTimeZone instance.

Creates an instance from a \DateTimeZone instance.

Parameters

$zone

Returns

ICanBoogie\TimeZoneLocation
public
# __construct( array $location )

Initializes the $location property.

Initializes the $location property.

Parameters

$location
Location information provided by \DateTimeZone::getLocation().
public
# __get( $property )

Returns the $country_code, $latitude, $longitude and $comments properties.

Returns the $country_code, $latitude, $longitude and $comments properties.

Throws

LogicException
in attempt to read an undefined property.

Inheritdoc

public
# __set( $property, $value )

Throws

LogicException
in attempt to write an undefined property.

Inheritdoc

public string
# __toString( )

Returns the instance formatted as "{$country_code},{$latitude},{$longitude}".

Returns the instance formatted as "{$country_code},{$latitude},{$longitude}".

Returns

string

Properties summary

Magic properties

public read-only string $country_code

The country code of the location.

public read-only float $latitude

The latitude of the location.

public read-only float $longitude

The longitude of the location.

public read-only string $comments

Comments on the location.

ICanBoogie/DateTime 2.0.x API documentation generated by ApiGen