From eb2fc16beac0d30d388d4f06718061422499d1b9 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Fri, 12 Oct 2007 08:04:51 +0000 Subject: add timezone parser --- functions/parse_tzs.php | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 functions/parse_tzs.php (limited to 'functions') diff --git a/functions/parse_tzs.php b/functions/parse_tzs.php new file mode 100644 index 0000000..85ab929 --- /dev/null +++ b/functions/parse_tzs.php @@ -0,0 +1,64 @@ +$tz_id"; print_r($tz_array[$tz_id]);echo""; + break; + default: + unset ( $data, $prop_pos, $property); + if (ereg ("([^:]+):(.*)", $line, $line)){ + $property = $line[1]; + $data = $line[2]; + $prop_pos = strpos($property,';'); + if ($prop_pos !== false) $property = substr($property,0,$prop_pos); + $property = strtoupper($property); + + switch ($property) { + case 'TZID': + $tz_id = $data; + break; + case 'TZOFFSETFROM': + $offset_from = $data; + break; + case 'TZOFFSETTO': + $offset_to = $data; + break; + } + } + } +} + +?> \ No newline at end of file -- cgit v1.2.3