In the PHP documentation, list of supported time zones, UTC
is listed twice:
UTC
Etc/UTC
Is there any conceptual difference between those two, or are they just synonyms?
In the PHP documentation, list of supported time zones, UTC
is listed twice:
UTC
Etc/UTC
Is there any conceptual difference between those two, or are they just synonyms?
NO, there is no difference between time zones UTC
and Etc/UTC
.
Etc/UTC
is a timezone in the Olson-timezone-database (tz database), also known as IANA-timezones-database, in which all timezones conform to a uniform naming convention: Area/Location
.
While most timezones (e.g. "Berlin") can be attributed to an area (e.g. "Europe", resulting in "Europe/Berlin"), some timezones cannot be attributed to any Area of the world (think continents or oceans). Thus, the special Area Etc
(Etcetera) was introduced. Area Etc
applies mainly to administrative timezones such as UTC
.
In summary: To conform with the naming convention, the universal coordinated time(zone) is named Etc/UTC
in the tz database.
For administrative timezones other than UTC (e.g. GMT+4
, GMT-8
), the tz database uses POSIX-style signs in the zone-names. POSIX has positive signs for zones that are behind Greenwich (west of Greenwich) and negative signs for zones that are ahead of Greenwich (east of Greenwich).
This POSIX convention is the opposite of the definition for timezones in the nowadays widespread and mostly used ISO 8601. In the ISO 8601 timezone format, negative signs indicate that a zone is behind UTC (west of Greenwich) and positive signs indicate a zone is ahead of UTC (east of Greenwich). Examples: "+03:00" in ISO 8601 equals GMT-3 in POSIX; "−05" in ISO 8601 equals "GMT5" in POSIX.
The ISO 8601 convention has become the effective standard nowadays, making POSIX timezones look confusing to some readers.
Etc/UTC
is the time zone whose display name is UTC
. That is, they're long and short names for the same timezone, per IANA's time zone database.
ETC/GMT+4 is the same as GMT-4.
public static void main(String[] args) {
TimeZone tz = TimeZone.getTimeZone("Etc/GMT-7");
System.out.println(tz);
tz = TimeZone.getTimeZone("GMT+7");
System.out.println(tz);
}
You can test it by yourself.
But I don't know what ETC mean..