~olivier-chatelain/php-addressbook/trunk

« back to all changes in this revision

Viewing changes to z-push/lib/utils/timezoneutil.php

  • Committer: chatelao
  • Date: 2016-09-11 07:59:37 UTC
  • Revision ID: git-v1:03926e44d99a04a3b05d4761e322a1f5e8a405d7
Chg: Upgrade z-push from 2.0.3 to 2.2.12 (stable)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
*
7
7
* Created   :   01.06.2012
8
8
*
9
 
* Copyright 2007 - 2012 Zarafa Deutschland GmbH
 
9
* Copyright 2007 - 2013 Zarafa Deutschland GmbH
10
10
*
11
11
* This program is free software: you can redistribute it and/or modify
12
12
* it under the terms of the GNU Affero General Public License, version 3,
1107
1107
            "tzname" => self::encodeTZName(self::getMSTZnameFromTZName($servertzname)),
1108
1108
            "dstendyear" => $offset[3],
1109
1109
            "dstendmonth" => $offset[4],
1110
 
            "dstendday" => $offset[6],
1111
 
            "dstendweek" => $offset[5],
 
1110
            "dstendday" => $offset[5],
 
1111
            "dstendweek" => $offset[6],
1112
1112
            "dstendhour" => $offset[7],
1113
1113
            "dstendminute" => $offset[8],
1114
1114
            "dstendsecond" => $offset[9],
1117
1117
            "tznamedst" => self::encodeTZName(self::getMSTZnameFromTZName($servertzname)),
1118
1118
            "dststartyear" => $offset[11],
1119
1119
            "dststartmonth" => $offset[12],
1120
 
            "dststartday" => $offset[14],
1121
 
            "dststartweek" => $offset[13],
 
1120
            "dststartday" => $offset[13],
 
1121
            "dststartweek" => $offset[14],
1122
1122
            "dststarthour" => $offset[15],
1123
1123
            "dststartminute" => $offset[16],
1124
1124
            "dststartsecond" => $offset[17],
1258
1258
        }
1259
1259
    }
1260
1260
 
 
1261
    /**
 
1262
     * Pack timezone info for Sync
 
1263
     *
 
1264
     * @param array     $tz
 
1265
     *
 
1266
     * @access private
 
1267
     * @return string
 
1268
     */
 
1269
    static public function GetSyncBlobFromTZ($tz) {
 
1270
        // set the correct TZ name (done using the Bias)
 
1271
        if (!isset($tz["tzname"]) || !$tz["tzname"] || !isset($tz["tznamedst"]) || !$tz["tznamedst"])
 
1272
            $tz = TimezoneUtil::FillTZNames($tz);
 
1273
 
 
1274
        $packed = pack("la64vvvvvvvv" . "la64vvvvvvvv" . "l",
 
1275
                $tz["bias"], $tz["tzname"], 0, $tz["dstendmonth"], $tz["dstendday"], $tz["dstendweek"], $tz["dstendhour"], $tz["dstendminute"], $tz["dstendsecond"], $tz["dstendmillis"],
 
1276
                $tz["stdbias"], $tz["tznamedst"], 0, $tz["dststartmonth"], $tz["dststartday"], $tz["dststartweek"], $tz["dststarthour"], $tz["dststartminute"], $tz["dststartsecond"], $tz["dststartmillis"],
 
1277
                $tz["dstbias"]);
 
1278
 
 
1279
        return $packed;
 
1280
    }
1261
1281
}
1262
1282
 
1263
1283
?>
 
 
b'\\ No newline at end of file'