1 | <?php |
||
26 | class TimeZone |
||
27 | { |
||
28 | /* |
||
29 | * Default Timezone used for date/time conversions |
||
30 | * |
||
31 | * @private |
||
32 | * @var string |
||
33 | */ |
||
34 | protected static $timezone = 'UTC'; |
||
35 | |||
36 | /** |
||
37 | * Validate a Timezone name |
||
38 | * |
||
39 | * @param string $timezone Time zone (e.g. 'Europe/London') |
||
40 | * @return bool Success or failure |
||
41 | */ |
||
42 | 2 | private static function validateTimeZone($timezone) |
|
50 | |||
51 | /** |
||
52 | * Set the Default Timezone used for date/time conversions |
||
53 | * |
||
54 | * @param string $timezone Time zone (e.g. 'Europe/London') |
||
55 | * @return bool Success or failure |
||
56 | */ |
||
57 | 2 | public static function setTimeZone($timezone) |
|
67 | |||
68 | /** |
||
69 | * Return the Default Timezone used for date/time conversions |
||
70 | * |
||
71 | * @return string Timezone (e.g. 'Europe/London') |
||
72 | */ |
||
73 | public static function getTimeZone() |
||
77 | |||
78 | /** |
||
79 | * Return the Timezone offset used for date/time conversions to/from UST |
||
80 | * This requires both the timezone and the calculated date/time to allow for local DST |
||
81 | * |
||
82 | * @param string $timezone The timezone for finding the adjustment to UST |
||
83 | * @param int $timestamp PHP date/time value |
||
84 | * @throws \PhpOffice\PhpSpreadsheet\Exception |
||
85 | * @return int Number of seconds for timezone adjustment |
||
86 | */ |
||
87 | public static function getTimeZoneAdjustment($timezone, $timestamp) |
||
106 | } |
||
107 |