Hello,
I want to set PST timezone using date_default_timezone_set(). What country I have to specify in the parameter in order to set PST timezone? Actually I want to get Facebook insights data & store it according to PST timezone as they are giving the data as PST timezone. Please help me. Thanks in advance.
Setting timezone PST using PHP
computerzworld wrote:What country I have to specify in the parameter in order to set PST timezone?
What country in the world uses a timezone called "PST"? (Though the argument to [man]date_default_timezone_set[/man] is usually a combination of a continent and a city, not a country).
Yes, I need continent & city that uses PST timezone. Thanks.
See the [man]timezones[/man] section of the PHP manual - it lists every possible value.
Ya I checked it but I was not sure which timezone to use for PST? Thanks.
Well, why do you need to use PST as opposed to, say, AWST? Is it something to do with the geographical location of your target audience (e.g., they're all in Pakistan)?
Presumably you have some sort of geographical constraint that is causing you to need a particular timezone. Otherwise you'd might as well just use Universal Time.
Weedpacket;10999797 wrote:What country in the world uses a timezone called "PST"?
The United States and Canada. PST is Pacific Standard Time.
America/Los_Angeles should to the job.
NogDog wrote:America/Los_Angeles should to the job.
Yes, but I was hoping computerzworld would look at the list and see it. For that to have failed would have required not knowing where Los Angeles is. Even then, a Google search for "PST timezone" would have located the city in the first two or three hits.
Bonesnap;10999839 wrote:The United States and Canada. PST is Pacific Standard Time.
Or Pakistan Standard Time; besides, I wasn't asking you
Weedpacket;10999856 wrote:Or Pakistan Standard Time; besides, I wasn't asking you
Pakistan Standard Time is PKT.
Pakistanis call it PST: http://www.ictadministration.gov.pk/ifacts.htm
But if you don't accept that: http://kidlat.pagasa.dost.gov.ph/agssb/tsu.htm
Hence PHP doesn't accept those acronyms as time zones - they are ambiguous.
Weedpacket;11000032 wrote:Pakistanis call it PST: http://www.ictadministration.gov.pk/ifacts.htm
But if you don't accept that: http://kidlat.pagasa.dost.gov.ph/agssb/tsu.htm
A Google search for "PST" will result in "Pacific Standard Time" results. A Google search for "PKT" results in Pakistan Standard Time.
Also, http://www.timeanddate.com/library/abbreviations/timezones/asia/pkt.html
http://www.worldtimezone.com/wtz-names/wtz-pkt.html
http://en.wikipedia.org/wiki/Pakistan_Standard_Time
http://wwp.greenwichmeantime.com/time-zone/asia/pakistan/ (only mentions PST as Pacific Standard Time)
Pakistan doesn't observe daylight saving time but North America does hence we have PST and PDT.
As for the Philippines they're PHT.
I concede: Wikipedia and Google are much better authorities on what the timezones for Pakistan and the Philippines are called than the Pakistani or Filipino governments.
Weedpacket;11000055 wrote:I concede: Wikipedia and Google are much better authorities on what the timezones for Pakistan and the Philippines are called than the Pakistani or Filipino governments.
I see you decided to only read the first and fifth lines of my post and ignore the others.
The government can write whatever they want on their website, it doesn't make it correct. That's like saying the correct way to implement border-radius is to use -moz-border-radius because that's what's on Mozilla's site, despite what the W3C says.
I'll take the information from the official GMT website, a source that's agnostic and unbiased, over a government website that looks like it was made in 1994. They set the standard, not the government.
And considering Google has no stake in what's "right" or "wrong", yeah, I would consider their results to be pretty accurate and reliable, but good thing I didn't just use Google, eh? Same with Wikipedia.
If you look up "pakistan standard time" you get results for PKT.
Bonesnap wrote:That's like saying the correct way to implement border-radius is to use -moz-border-radius because that's what's on Mozilla's site, despite what the W3C says.
Here, Mozilla is using a vendor-specific extension to support a nonstandard feature; a practice explicitly allowed for by the CSS specification (ยง4.1.21).
Bonesnap wrote:They set the standard, not the government.
By "they" you mean organisations like the U.K's National Physical Laboratory, United States Naval Observatory, and NIST? Or do you mean "they" as in private companies that have picked themselves a name that makes them sound affiliated with the Royal Greenwich Observatory, which, incidentally, does not maintain current time? You can tell that the latter is not authoritative on what time zones are called, because the official name for Coordinated Universal Time is not "Greenwich Mean Time" (abbreviated GMT), it's "Coordinated Universal Time" (abbreviated UTC).
Bonesnap wrote:They set the standard, not the government.
Wrong. Governments are free set their timezones and what they're called however they please. It's why Samoa was able to change because after deciding it would make more sense to be on the same side of the date line as almost everyone they deal with. It's why China is able to have a single timezone despite stretching across more than 70ยฐ of longitude.
Bonesnap wrote:They set the standard, not the government.
Wrong. See (for example), the German Time Act 1978
http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/s3.html
http://www.legislation.govt.nz/act/public/1974/0039/latest/whole.html
So there are at least three countries who got it into their metaphorical heads to try and do what you say they can't.
Unless by "standard" you mean ISO 8601; which specifies the identification of timezones in terms of their offsets from UTC, but nothing about who observes which timezones or what they call them.
Or you mean the "Olson" tz database, for which I would regularly visit the elsie server at the National Institutes for Health (back before it was picked up by ICANN); that being the only maintained compilation of current timezone offsets (which is why so many people and systems rely on it, including PHP - being the only such source, it's as close to authoritative as you can get). Even so, it's a compilation of information collected from individual sources (for which citations are given in the database) and not a ruling on what those offsets should be (in other words, it's descriptive, not prescriptive).
Bonesnap wrote:...that looks like it was made in 1994
Oh, well, then. If it that's your criterion, then you'll be ignoring the leap second bulletins put out by the IERS, won't you? (Oh, look; they actually updated the look earlier this century. It used to be much more 1994.)
Weedpacket;11000060 wrote:Here, Mozilla is using a vendor-specific extension to support a nonstandard feature; a practice explicitly allowed for by the CSS specification (ยง4.1.21).
Sure but if you were to put that code through W3C's validation service it would fail, since vendor-specific properties are not standards (that's what I meant).
Weedpacket;11000060 wrote:By "they" you mean organisations like the U.K's National Physical Laboratory, United States Naval Observatory, and NIST? Or do you mean "they" as in private companies that have picked themselves a name that makes them sound affiliated with the Royal Greenwich Observatory, which, incidentally, does not maintain current time? You can tell that the latter is not authoritative on what time zones are called, because the official name for Coordinated Universal Time is not "Greenwich Mean Time" (abbreviated GMT), it's "Coordinated Universal Time" (abbreviated UTC).
Wrong. Governments are free set their timezones and what they're called however they please. It's why Samoa was able to change because after deciding it would make more sense to be on the same side of the date line as almost everyone they deal with. It's why China is able to have a single timezone despite stretching across more than 70ยฐ of longitude.
Wrong. See (for example), the German Time Act 1978
http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/s3.html
http://www.legislation.govt.nz/act/public/1974/0039/latest/whole.html
So there are at least three countries who got it into their metaphorical heads to try and do what you say they can't.Unless by "standard" you mean ISO 8601; which specifies the identification of timezones in terms of their offsets from UTC, but nothing about who observes which timezones or what they call them.
Or you mean the "Olson" tz database, for which I would regularly visit the elsie server at the National Institutes for Health (back before it was picked up by ICANN); that being the only maintained compilation of current timezone offsets (which is why so many people and systems rely on it, including PHP - being the only such source, it's as close to authoritative as you can get). Even so, it's a compilation of information collected from individual sources (for which citations are given in the database) and not a ruling on what those offsets should be (in other words, it's descriptive, not prescriptive).
Of course countries can choose what time zone they're in or what "time" they're in. I just meant that the names are agreed upon and standardized on an international level.
It seems pretty clear to me that PKT is the internationally recognized abbreviation for Pakistan Standard Time. It's not like the abbreviation PKT was just "made up" randomly (likewise for PHT). It was most likely created to avoid confusion with Pacific Standard Time and prevent discussions like this one .
You may be right that locals call it PST but honestly just because it appears on a government website doesn't mean the population follows suit. The Canadian government's website is littered with dates in the dd/mm/yyyy format so you would assume that's how Canadians write the date but I don't know a single person who writes the date in that format. We also don't say "Twenty-eighth of March, two thousand twelve". Instead we almost always write it in mm/dd/yyyy format and say, "March twenty-eighth two thousand twelve".
Weedpacket;11000060 wrote:Oh, well, then. If it that's your criterion, then you'll be ignoring the leap second bulletins put out by the IERS, won't you? (Oh, look; they actually updated the look earlier this century. It used to be much more 1994.)
I didn't say that was the only criteria, but forgive me if I give a little more credence to something that looks more modern and maintained.
Bonesnap wrote:You may be right that locals call it PST but honestly just because it appears on a government website doesn't mean the population follows suit.
So, tell me: what does the population of Pakistan (or India, or Bangladesh) use?
Bonesnap wrote:Of course countries can choose what time zone they're in or what "time" they're in. I just meant that the names are agreed upon and standardized on an international level.
Show me the agreement. Show me the standard. Show me the body that ratifies it. Show me reference to this body in any of the three pieces of legislation I linked to (and appear in the passage you quoted) defer to this body in getting their timezones named. NIST maintain time for the United States, but they don't have anything to do with the time zones (those are specified by the U.S. government, which, to again judge from the relevant legislation, didn't have to seek permission from anyone about what to call them).
And to quote from the IANA's documentation of the tz database (something the very existence of which throws into doubt the idea that there is some official time zone authority, because if one existed, why did so much of its work have to be replicated by someone working at the National Institutes of Health?
Alphabetic time zone abbreviations should not be used as unique identifiers for UTC offsets as they are ambiguous in practice. For example, "EST" denotes 5 hours behind UTC in English-speaking North America, but it denotes 10 or 11 hours ahead of UTC in Australia; and French-speaking North Americans prefer "HNE" to "EST". For POSIX the tz database contains English abbreviations for all time stamps but in many cases these are merely inventions of the database maintainers.
Bonesnap wrote:I didn't say that was the only criteria, but forgive me if I give a little more credence to something that looks more modern and maintained.
So ... more like the Pakistani one, then?
Bonesnap;11000173 wrote:Sure but if you were to put that code through W3C's validation service it would fail, since vendor-specific properties are not standards (that's what I meant).
But just because you mean it doens't mean it's true. It WILL validate.
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta charset="utf-8">
<style type="text/css">
div
{
border: 3px solid black;
-moz-border-radius: 10px;
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>
This document was successfully checked as HTML5!
Notice the "-"?