convert.php 596 B

12345678910111213141516171819202122
  1. <?php
  2. $tzLinux = [];
  3. $file = fopen("data/timezone_n.csv","r+");
  4. while(! feof($file)){
  5. $tmp = fgetcsv($file);
  6. $tzLinux[$tmp[0]] = $tmp[1];
  7. }
  8. fclose($file);
  9. ksort($tzLinux);
  10. $tz = json_decode(file_get_contents('data/wintz.json'));
  11. foreach($tz->{"supplementalData"}->{"windowsZones"}->{"mapTimezones"}->{"mapZone"} as $item){
  12. if(isset($tzLinux[$item->{"_type"}])){
  13. echo $item->{"_type"}.",".$tzLinux[$item->{"_type"}].",".$item->{"_other"}."\r\n";
  14. }
  15. //,$item->{"_other"}
  16. //if($item->{"_type"} == $name){
  17. //$tz_win = $item->{"_other"};
  18. //};
  19. }
  20. ?>