Short answers are, no, and if.
The practical answer on timezones in php is not always short.
Confusion can arise where you are in one location, your host is in another (based primarily in, say, London or Redmond or Houston or Santa Rosa), and your machine is in yet another (respectively Illinois or California or Utah or Texas). That seems to have fostered some of the confusion well above where offsets were not making complete sense to people relative to host, zero longitude (gmt, utc), and hometown.
____________________________________________________
(1) Your host might allow you access to a reasonably full php.ini for your account, perhaps in basic and advanced views. (The server's own master php.ini is on the order of 2,000 lines long, you will not be allowed to touch those.) In such a php.ini are these "timezone" entries (for the nn.mmm formats see further down):
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
; Defines the default timezone used by the date functions
;date.timezone =
;date.default_latitude = nn.mmmm
;date.default_longitude = nn.mmmm
;date.sunrise_zenith = nn.mmmm
;date.sunset_zenith = nn.mmmm
date.timezone = "UTC"
You can likewise also uncomment (remove ;) these two so as to have:
date.default_latitude = [use the nn.mmmm format explained below] ; precede with a ";" any notes to yourself
date.default_longitude = [use the nn.mmmm format explained below] ; precede with a ";" any notes to yourself
You can use phpinfo.php to see what you've accomplished that you may need to edit.
____________________________________________________
(2) One group of specifics, with examples:
http://www.php.net/manual/en/function.date-date-set.php
date_date_set — Alias of DateTime::setDate
http://www.php.net/manual/en/function.d ... ne-get.php
date_default_timezone_get — Gets the default timezone used by all date/time functions in a script
http://www.php.net/manual/en/function.d ... ne-set.php
date_default_timezone_set — Sets the default timezone used by all date/time functions in a script
____________________________________________________
(3) Another group of specifics:
Supported Date and Time Formats
Time Formats
Date Formats
Compound Formats
Relative Formats
in detail at:
http://www.php.net/manual/en/datetime.formats.time.php
http://www.php.net/manual/en/datetime.formats.date.php
http://www.php.net/manual/en/datetime.f ... mpound.php
http://www.php.net/manual/en/datetime.f ... lative.php
____________________________________________________
(4) More than you ever wanted to know about time a la php is outlined here:
http://www.php.net/manual/en/book.datetime.php
at . . .
date_time_set — Alias of DateTime::setTime
date_timestamp_get — Alias of DateTime::getTimestamp
date_timestamp_set — Alias of DateTime::setTimestamp
date_timezone_get — Alias of DateTime::getTimezone
date_timezone_set — Alias of DateTime::setTimezone
date — Format a local time/date
getdate — Get date/time information
gettimeofday — Get current time
gmdate — Format a GMT/UTC date/time
gmmktime — Get Unix timestamp for a GMT date
gmstrftime — Format a GMT/UTC time/date according to locale settings
idate — Format a local time/date as integer
localtime — Get the local time
microtime — Return current Unix timestamp with microseconds
mktime — Get Unix timestamp for a date
strftime — Format a local time/date according to locale settings
strptime — Parse a time/date generated with strftime
strtotime — Parse about any English textual datetime description into a Unix timestamp
time — Return current Unix timestamp
timezone_abbreviations_list — Alias of DateTimeZone::listAbbreviations
timezone_identifiers_list — Alias of DateTimeZone::listIdentifiers
timezone_location_get — Alias of DateTimeZone::getLocation
timezone_name_from_abbr — Returns the timezone name from abbreviation
timezone_name_get — Alias of DateTimeZone::getName
timezone_offset_get — Alias of DateTimeZone::getOffset
timezone_open — Alias of DateTimeZone::__construct
timezone_transitions_get — Alias of DateTimeZone::getTransitions
timezone_version_get — Gets the version of the timezonedb