Re: new DateTimeZone and html encoding [message #172838 is a reply to message #172835] |
Fri, 04 March 2011 12:20 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma:
|
Senior Member |
|
|
El 04/03/2011 12:12, polilop escribió/wrote:
>> $oldTZone= new DateTimeZone("Pacific Time (US & Canada");
>> or
>> $oldTZone=timezone_open("Pacific Time (US & Canada")
>> i get
>> Unknown or bad timezone (Pacific Time (US & Canada))
>>
>> it seems that it encodes the &. How can i disable it from doing so?
>>
> No.
> The supported timeszones are listed here:
> http://www.php.net/manual/en/timezones.php
>
> Yap, youre right. I'm using icalc to read ics exported from outlook.
> some versions of office give the timezones as listed,
> but office 2007 gives as i stated above so i thought they were allso legit.
It's funny but American web sites love to provide time in their local
time (which is fine, I do it as well) and identify the time zone as
"Pacific Time", as if the Pacific ocean was a small lake near Greenwich.
I presume your actual question is how to parse a string with a free
English description of a time zone and extract the actual information. I
see no other way than compiling a database with all the possible variations.
ICS is (supposedly) a standardised format. The funny thing is that «does
not define a naming convention for time zone identifiers»
http://tools.ietf.org/html/rfc5545#section-3.2.19
At least, there's a link to a public domain TZ database...
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|