DateTimeZone::__constructtimezone_openCreates new DateTimeZone object DescriptionObject oriented style
public DateTimeZone::__construct
( string
$timezone
)Procedural style
DateTimeZone timezone_open
( string
$timezone
)Creates new DateTimeZone object. Return Values
Returns DateTimeZone on success.
Procedural style returns Errors/ExceptionsThis method throws Exception if the timezone supplied is not recognised as a valid timezone. Examples
Example #1 Catching errors when instantiating DateTimeZone
<?php The above example will output: DateTimeZone::__construct() [datetimezone.--construct]: Unknown or bad timezone (Mars/Phobos) DateTimeZone::__construct() [datetimezone.--construct]: Unknown or bad timezone (Jupiter/Europa) |