Setting timezone PST using PHP - Page 2
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22

Thread: Setting timezone PST using PHP

  1. #16
    Senior Member
    Join Date
    Mar 2009
    Posts
    819
    Quote Originally Posted by Weedpacket View Post
    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.
    Declare variables, not war.

  2. #17
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,910

    Duty calls...

    Quote Originally Posted by Bonesnap
    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).

    Quote Originally Posted by Bonesnap
    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).

    Quote Originally Posted by Bonesnap
    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.

    Quote Originally Posted by Bonesnap
    They set the standard, not the government.
    Wrong. See (for example), the German Time Act 1978
    http://www.austlii.edu.au/au/legis/n...987137/s3.html
    http://www.legislation.govt.nz/act/p...est/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).

    Quote Originally Posted by Bonesnap
    ...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.)
    Last edited by Weedpacket; 03-27-2012 at 03:32 AM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  3. #18
    Senior Member
    Join Date
    Mar 2009
    Posts
    819
    Quote Originally Posted by Weedpacket View Post
    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).

    Quote Originally Posted by Weedpacket View Post
    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/n...987137/s3.html
    http://www.legislation.govt.nz/act/p...est/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".

    Quote Originally Posted by Weedpacket View Post
    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.
    Declare variables, not war.

  4. #19
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,910
    Quote Originally Posted by Bonesnap
    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?

    Quote Originally Posted by Bonesnap
    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.
    Quote Originally Posted by Bonesnap
    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?
    Last edited by Weedpacket; 03-28-2012 at 03:00 AM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  5. #20
    Senior Member
    Join Date
    Jul 2007
    Posts
    3,675
    Quote Originally Posted by Bonesnap View Post
    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.

    HTML Code:
    <!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 "-"?
    Last edited by johanafm; 03-28-2012 at 07:41 AM.

  6. #21
    Senior Member
    Join Date
    Mar 2009
    Posts
    819
    Quote Originally Posted by Weedpacket View Post
    So, tell me: what does the population of Pakistan (or India, or Bangladesh) use?
    I don't know. I was just illustrating the point that just because something is posted on a government website doesn't mean the citizens follow it. An admin on an another forum I post on is Indian but he's rarely around and honestly I don't care enough to ask him.

    Quote Originally Posted by Weedpacket View Post
    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?
    Poor choice of words on my part. I mean a de facto standard. Obviously the PKT abbreviation has some recognition beyond a single locale.

    Quote Originally Posted by johanafm View Post
    But just because you mean it doens't mean it's true. It WILL validate.

    HTML Code:
    <!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>


    Notice the "-"?
    You're running it through the markup validator; try putting it through the CSS validator since that's what you're actually testing.

    It fails (even when testing for CSS3):

    Sorry! We found the following errors (1)

    11 div Property -moz-border-radius doesn't exist : 10px
    Declare variables, not war.

  7. #22
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,910
    In short, you're backing down from:
    Quote Originally Posted by Bonesnap
    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.
    You're admitting that there is no official organisation responsible for the names of time zones - those are provided by whoever has jurisdiction in the relevant territories. Nor is there any official standard for how those names are abbreviated, only local custom - although if one faction pushes its customs insistently enough others might get the idea that they have some sort of authority on the matter.

    If you knew of the existence of this "official GMT website" then you ought to have provided a link for it, instead of the ones you did provide, which say:
    Information on this website may contain technical inaccuracies or typographical errors. Information may be changed or updated without notice. Time and Date AS may also make improvements and/or changes in the products and/or the services at any time without notice. Time and Date AS takes absolutely no responsibility for any errors on the site. You use the information at your own risk.
    http://www.timeanddate.com/information/disclaimer.html
    Greenwich 2000 Limited makes no warranty that the Website/Services will meet your requirements, that Content will be accurate or reliable, that the functionality of the Website/Services will be uninterrupted or error free, that defects will be corrected or that the Website/Services or the server that makes them available are free of viruses or anything else which may be harmful or destructive.
    http://wwp.greenwich2000.ltd.uk/legal.htm
    • Some zone abbreviation(s) are not unique, and have different time offsets
    • Some zone abbreviations are no longer in use and provided as historical reference
    • Some countries and territories have more then one time zone abbreviation
    • This data is by no means authoritative and have to be used as reference

    http://www.worldtimezone.com/wtz-nam...zonenames.html
    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.
    Still wrong. The names of the timezones are specified in the U.S. Code (link already provided). Ditto for New Zealand Standard time (link already provided). And (as already noted), there's no standard or international agreement on how they're abbreviated (although there is a hint in the tz database's documentation that ChST is so-called by law.)

    Some time back I was involved on a rather large development project in which multiple timezones had to be handled in a consistent manner. So I helped search for relevant international conventions. The only one recognised was UTC+offset. The fact that this was a "System Fails People Die"-type system, where confusion about the difference between AST and AST was very likely to result in funerals meant that those and other ad hoc abbreviations were utterly useless for any but the most parochial of purposes.

    Oh, and forgive me for preferring to get my information from sites that do not try to pay their way by advertising Ukrainian dating agencies.
    Last edited by Weedpacket; 03-30-2012 at 01:39 AM.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •