@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * Set the Default timezone to use for dates |
114 | 114 | * |
115 | - * @param string|\DateTimeZone $timezone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
115 | + * @param string|\DateTimeZone $timeZone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
116 | 116 | * @return boolean Success or failure |
117 | 117 | * @throws \Exception |
118 | 118 | */ |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | /** |
142 | 142 | * Validate a timezone |
143 | 143 | * |
144 | - * @param string|\DateTimeZone $timezone The timezone to validate, either as a timezone string or object |
|
144 | + * @param string|\DateTimeZone $timeZone The timezone to validate, either as a timezone string or object |
|
145 | 145 | * @return \DateTimeZone The timezone as a timezone object |
146 | 146 | * @throws \Exception |
147 | 147 | */ |
@@ -158,8 +158,7 @@ discard block |
||
158 | 158 | /** |
159 | 159 | * Convert a MS serialized datetime value from Excel to a PHP Date/Time object |
160 | 160 | * |
161 | - * @param integer|float $dateValue MS Excel serialized date/time value |
|
162 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
161 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
163 | 162 | * if you don't want to treat it as a UTC value |
164 | 163 | * Use the default (UST) unless you absolutely need a conversion |
165 | 164 | * @return \DateTime PHP date/time object |
@@ -196,8 +195,7 @@ discard block |
||
196 | 195 | /** |
197 | 196 | * Convert a MS serialized datetime value from Excel to a unix timestamp |
198 | 197 | * |
199 | - * @param integer|float $dateValue MS Excel serialized date/time value |
|
200 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
198 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
201 | 199 | * if you don't want to treat it as a UTC value |
202 | 200 | * Use the default (UST) unless you absolutely need a conversion |
203 | 201 | * @return integer Unix timetamp for this date/time |
@@ -212,7 +210,7 @@ discard block |
||
212 | 210 | /** |
213 | 211 | * Convert a date from PHP to an MS Excel serialized date/time value |
214 | 212 | * |
215 | - * @param mixed $dateValue PHP serialized date/time or date object |
|
213 | + * @param integer $dateValue PHP serialized date/time or date object |
|
216 | 214 | * @return float|boolean Excel date/time value |
217 | 215 | * or boolean FALSE on failure |
218 | 216 | */ |
@@ -250,7 +248,7 @@ discard block |
||
250 | 248 | /** |
251 | 249 | * Convert a Unix timestamp to an MS Excel serialized date/time value |
252 | 250 | * |
253 | - * @param \DateTimeInterface $dateValue PHP DateTime object |
|
251 | + * @param integer $dateValue PHP DateTime object |
|
254 | 252 | * @return float MS Excel serialized date/time value |
255 | 253 | */ |
256 | 254 | public static function timestampToExcel($dateValue = 0) |
@@ -270,7 +268,7 @@ discard block |
||
270 | 268 | * @param integer $hours |
271 | 269 | * @param integer $minutes |
272 | 270 | * @param integer $seconds |
273 | - * @return integer Excel date/time value |
|
271 | + * @return double Excel date/time value |
|
274 | 272 | */ |
275 | 273 | public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) |
276 | 274 | { |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | class Date |
31 | 31 | { |
32 | 32 | /** constants */ |
33 | - const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
34 | - const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
33 | + const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
34 | + const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
35 | 35 | |
36 | 36 | /* |
37 | 37 | * Names of the months of the year, indexed by shortname |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | return false; |
389 | 389 | } |
390 | 390 | // Try checking for any of the date formatting characters that don't appear within square braces |
391 | - if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $pFormatCode)) { |
|
391 | + if (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $pFormatCode)) { |
|
392 | 392 | // We might also have a format mask containing quoted strings... |
393 | 393 | // we don't want to test for any of our characters within the quoted blocks |
394 | 394 | if (strpos($pFormatCode, '"') !== false) { |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | foreach (explode('"', $pFormatCode) as $subVal) { |
397 | 397 | // Only test in alternate array entries (the non-quoted blocks) |
398 | 398 | if (($segMatcher = !$segMatcher) && |
399 | - (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $subVal))) { |
|
399 | + (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $subVal))) { |
|
400 | 400 | return true; |
401 | 401 | } |
402 | 402 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | ); |
15 | 15 | |
16 | 16 | foreach ($calendarValues as $calendarValue) { |
17 | - $result = call_user_func(array(Date::class,'setExcelCalendar'), $calendarValue); |
|
17 | + $result = call_user_func(array(Date::class, 'setExcelCalendar'), $calendarValue); |
|
18 | 18 | $this->assertTrue($result); |
19 | 19 | } |
20 | 20 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function testSetExcelCalendarWithInvalidValue() |
23 | 23 | { |
24 | 24 | $unsupportedCalendar = '2012'; |
25 | - $result = call_user_func(array(Date::class,'setExcelCalendar'), $unsupportedCalendar); |
|
25 | + $result = call_user_func(array(Date::class, 'setExcelCalendar'), $unsupportedCalendar); |
|
26 | 26 | $this->assertFalse($result); |
27 | 27 | } |
28 | 28 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function testDateTimeExcelToTimestamp1900() |
33 | 33 | { |
34 | 34 | $result = call_user_func( |
35 | - array(Date::class,'setExcelCalendar'), |
|
35 | + array(Date::class, 'setExcelCalendar'), |
|
36 | 36 | Date::CALENDAR_WINDOWS_1900 |
37 | 37 | ); |
38 | 38 | |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | public function testDateTimeTimestampToExcel1900() |
54 | 54 | { |
55 | 55 | $result = call_user_func( |
56 | - array(Date::class,'setExcelCalendar'), |
|
56 | + array(Date::class, 'setExcelCalendar'), |
|
57 | 57 | Date::CALENDAR_WINDOWS_1900 |
58 | 58 | ); |
59 | 59 | |
60 | 60 | $args = func_get_args(); |
61 | 61 | $expectedResult = array_pop($args); |
62 | - $result = call_user_func_array(array(Date::class,'timestampToExcel'), $args); |
|
62 | + $result = call_user_func_array(array(Date::class, 'timestampToExcel'), $args); |
|
63 | 63 | $this->assertEquals($expectedResult, $result, null, 1E-5); |
64 | 64 | } |
65 | 65 | |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | public function testDateTimeDateTimeToExcel() |
75 | 75 | { |
76 | 76 | $result = call_user_func( |
77 | - array(Date::class,'setExcelCalendar'), |
|
77 | + array(Date::class, 'setExcelCalendar'), |
|
78 | 78 | Date::CALENDAR_WINDOWS_1900 |
79 | 79 | ); |
80 | 80 | |
81 | 81 | $args = func_get_args(); |
82 | 82 | $expectedResult = array_pop($args); |
83 | - $result = call_user_func_array(array(Date::class,'dateTimeToExcel'), $args); |
|
83 | + $result = call_user_func_array(array(Date::class, 'dateTimeToExcel'), $args); |
|
84 | 84 | $this->assertEquals($expectedResult, $result, null, 1E-5); |
85 | 85 | } |
86 | 86 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | public function testDateTimeFormattedPHPToExcel1900() |
96 | 96 | { |
97 | 97 | $result = call_user_func( |
98 | - array(Date::class,'setExcelCalendar'), |
|
98 | + array(Date::class, 'setExcelCalendar'), |
|
99 | 99 | Date::CALENDAR_WINDOWS_1900 |
100 | 100 | ); |
101 | 101 | |
102 | 102 | $args = func_get_args(); |
103 | 103 | $expectedResult = array_pop($args); |
104 | - $result = call_user_func_array(array(Date::class,'formattedPHPToExcel'), $args); |
|
104 | + $result = call_user_func_array(array(Date::class, 'formattedPHPToExcel'), $args); |
|
105 | 105 | $this->assertEquals($expectedResult, $result, null, 1E-5); |
106 | 106 | } |
107 | 107 | |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | public function testDateTimeExcelToTimestamp1904() |
117 | 117 | { |
118 | 118 | $result = call_user_func( |
119 | - array(Date::class,'setExcelCalendar'), |
|
119 | + array(Date::class, 'setExcelCalendar'), |
|
120 | 120 | Date::CALENDAR_MAC_1904 |
121 | 121 | ); |
122 | 122 | |
123 | 123 | $args = func_get_args(); |
124 | 124 | $expectedResult = array_pop($args); |
125 | - $result = call_user_func_array(array(Date::class,'excelToTimestamp'), $args); |
|
125 | + $result = call_user_func_array(array(Date::class, 'excelToTimestamp'), $args); |
|
126 | 126 | $this->assertEquals($expectedResult, $result); |
127 | 127 | } |
128 | 128 | |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | public function testDateTimeTimestampToExcel1904() |
138 | 138 | { |
139 | 139 | $result = call_user_func( |
140 | - array(Date::class,'setExcelCalendar'), |
|
140 | + array(Date::class, 'setExcelCalendar'), |
|
141 | 141 | Date::CALENDAR_MAC_1904 |
142 | 142 | ); |
143 | 143 | |
144 | 144 | $args = func_get_args(); |
145 | 145 | $expectedResult = array_pop($args); |
146 | - $result = call_user_func_array(array(Date::class,'timestampToExcel'), $args); |
|
146 | + $result = call_user_func_array(array(Date::class, 'timestampToExcel'), $args); |
|
147 | 147 | $this->assertEquals($expectedResult, $result, null, 1E-5); |
148 | 148 | } |
149 | 149 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $args = func_get_args(); |
161 | 161 | $expectedResult = array_pop($args); |
162 | - $result = call_user_func_array(array(Date::class,'isDateTimeFormatCode'), $args); |
|
162 | + $result = call_user_func_array(array(Date::class, 'isDateTimeFormatCode'), $args); |
|
163 | 163 | $this->assertEquals($expectedResult, $result); |
164 | 164 | } |
165 | 165 | |
@@ -174,13 +174,13 @@ discard block |
||
174 | 174 | public function testDateTimeExcelToTimestamp1900Timezone() |
175 | 175 | { |
176 | 176 | $result = call_user_func( |
177 | - array(Date::class,'setExcelCalendar'), |
|
177 | + array(Date::class, 'setExcelCalendar'), |
|
178 | 178 | Date::CALENDAR_WINDOWS_1900 |
179 | 179 | ); |
180 | 180 | |
181 | 181 | $args = func_get_args(); |
182 | 182 | $expectedResult = array_pop($args); |
183 | - $result = call_user_func_array(array(Date::class,'excelToTimestamp'), $args); |
|
183 | + $result = call_user_func_array(array(Date::class, 'excelToTimestamp'), $args); |
|
184 | 184 | $this->assertEquals($expectedResult, $result); |
185 | 185 | } |
186 | 186 |
@@ -2,19 +2,19 @@ |
||
2 | 2 | |
3 | 3 | // DateTime object Result Comments |
4 | 4 | return [ |
5 | - [ new DateTime('1900-01-01'), 1.0 ], // Excel 1900 base calendar date |
|
6 | - [ new DateTime('1900-02-28'), 59.0 ], // This and next test show gap for the mythical |
|
7 | - [ new DateTime('1900-03-01'), 61.0 ], // MS Excel 1900 Leap Year |
|
8 | - [ new DateTime('1901-12-14'), 714.0 ], // Unix Timestamp 32-bit Earliest Date |
|
9 | - [ new DateTime('1903-12-31'), 1461.0 ], |
|
10 | - [ new DateTime('1904-01-01'), 1462.0 ], // Excel 1904 Calendar Base Date |
|
11 | - [ new DateTime('1904-01-02'), 1463.0 ], |
|
12 | - [ new DateTime('1960-12-19'), 22269.0 ], |
|
13 | - [ new DateTime('1970-01-01'), 25569.0 ], // Unix Timestamp Base Date |
|
14 | - [ new DateTime('1982-12-07'), 30292.0 ], |
|
15 | - [ new DateTime('2008-06-12'), 39611.0 ], |
|
16 | - [ new DateTime('2038-01-19'), 50424.0 ], // Unix Timestamp 32-bit Latest Date |
|
17 | - [ new DateTime('1903-05-18 13:37:46'), 1234.56789 ], |
|
18 | - [ new DateTime('1933-10-18 16:17:37'), 12345.6789 ], |
|
19 | - [ new DateTime('2099-12-31'), 73050.0 ], |
|
5 | + [new DateTime('1900-01-01'), 1.0], // Excel 1900 base calendar date |
|
6 | + [new DateTime('1900-02-28'), 59.0], // This and next test show gap for the mythical |
|
7 | + [new DateTime('1900-03-01'), 61.0], // MS Excel 1900 Leap Year |
|
8 | + [new DateTime('1901-12-14'), 714.0], // Unix Timestamp 32-bit Earliest Date |
|
9 | + [new DateTime('1903-12-31'), 1461.0], |
|
10 | + [new DateTime('1904-01-01'), 1462.0], // Excel 1904 Calendar Base Date |
|
11 | + [new DateTime('1904-01-02'), 1463.0], |
|
12 | + [new DateTime('1960-12-19'), 22269.0], |
|
13 | + [new DateTime('1970-01-01'), 25569.0], // Unix Timestamp Base Date |
|
14 | + [new DateTime('1982-12-07'), 30292.0], |
|
15 | + [new DateTime('2008-06-12'), 39611.0], |
|
16 | + [new DateTime('2038-01-19'), 50424.0], // Unix Timestamp 32-bit Latest Date |
|
17 | + [new DateTime('1903-05-18 13:37:46'), 1234.56789], |
|
18 | + [new DateTime('1933-10-18 16:17:37'), 12345.6789], |
|
19 | + [new DateTime('2099-12-31'), 73050.0], |
|
20 | 20 | ]; |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | // Year Month Day Hours Minutes Seconds Result Comments |
4 | 4 | return [ |
5 | - [ 1901, 12, 14, 714 ], // PHP 32-bit Earliest Date 14-Dec-1901 |
|
6 | - [ 1903, 12, 31, 1461 ], // 31-Dec-1903 |
|
7 | - [ 1904, 1, 1, 1462 ], // Excel 1904 Calendar Base Date 01-Jan-1904 |
|
8 | - [ 1904, 1, 2, 1463 ], // 02-Jan-1904 |
|
9 | - [ 1960, 12, 19, 22269 ], // 19-Dec-1960 |
|
10 | - [ 1970, 1, 1, 25569 ], // PHP Base Date 01-Jan-1970 |
|
11 | - [ 1982, 12, 7, 30292 ], // 07-Dec-1982 |
|
12 | - [ 2008, 6, 12, 39611 ], // 12-Jun-2008 |
|
13 | - [ 2038, 1, 19, 50424 ], // PHP 32-bit Latest Date 19-Jan-2038 |
|
14 | - [ 1903, 5, 18, 13, 37, 46, 1234.56789 ], // 18-May-1903 13:37:46 |
|
15 | - [ 1933, 10, 18, 16, 17, 37, 12345.6789 ], // 18-Oct-1933 16:17:37 |
|
5 | + [1901, 12, 14, 714], // PHP 32-bit Earliest Date 14-Dec-1901 |
|
6 | + [1903, 12, 31, 1461], // 31-Dec-1903 |
|
7 | + [1904, 1, 1, 1462], // Excel 1904 Calendar Base Date 01-Jan-1904 |
|
8 | + [1904, 1, 2, 1463], // 02-Jan-1904 |
|
9 | + [1960, 12, 19, 22269], // 19-Dec-1960 |
|
10 | + [1970, 1, 1, 25569], // PHP Base Date 01-Jan-1970 |
|
11 | + [1982, 12, 7, 30292], // 07-Dec-1982 |
|
12 | + [2008, 6, 12, 39611], // 12-Jun-2008 |
|
13 | + [2038, 1, 19, 50424], // PHP 32-bit Latest Date 19-Jan-2038 |
|
14 | + [1903, 5, 18, 13, 37, 46, 1234.56789], // 18-May-1903 13:37:46 |
|
15 | + [1933, 10, 18, 16, 17, 37, 12345.6789], // 18-Oct-1933 16:17:37 |
|
16 | 16 | ]; |
@@ -2,26 +2,26 @@ |
||
2 | 2 | |
3 | 3 | // Excel DateTimeStamp Timezone Result Comments |
4 | 4 | return [ |
5 | - [ 22269, 'America/New_York', -285102000 ], // 19-Dec-1960 00:00:00 EST => 19-Dec-1960 05:00:00 UTC |
|
6 | - [ 25569, 'America/New_York', 18000 ], // 01-Jan-1970 00:00:00 EST => 01-Jan-1970 05:00:00 UTC PHP Base Date |
|
7 | - [ 30292, 'America/New_York', 408085200 ], // 07-Dec-1982 00:00:00 EST => 07-Dec-1982 05:00:00 UTC |
|
8 | - [ 39611, 'America/New_York', 1213243200 ], // 12-Jun-2008 00:00:00 EDT => 12-Jun-2008 04:00:00 UTC |
|
9 | - [ 50424, 'America/New_York', 2147490000 ], // 19-Jan-2038 00:00:00 EST => 19-Jan-2038 05:00:00 UTC PHP 32-bit Latest Date |
|
10 | - [ 22345.56789, 'America/New_York', -278486534 ], // 05-Mar-1961 13:37:46 EST => 05-Mar-1961 18:37:46 UTC |
|
11 | - [ 22345.6789, 'America/New_York', -278476943 ], // 05-Mar-1961 16:17:37 EST => 05-Mar-1961 21:17:37 UTC |
|
12 | - [ 0.5, 'America/New_York', 61200 ], // 12:00:00 EST => 17:00:00 UTC |
|
13 | - [ 0.75, 'America/New_York', 82800 ], // 18:00.00 EST => 23:00:00 UTC |
|
14 | - [ 0.12345, 'America/New_York', 28666 ], // 02:57:46 EST => 07:57:46 UTC |
|
15 | - [ 41215, 'America/New_York', 1351828800 ], // 02-Nov-2012 00:00:00 EDT => 02-Nov-2012 04:00:00 UTC |
|
16 | - [ 22269, 'Pacific/Auckland', -285163200 ], // 19-Dec-1960 00:00:00 NZST => 18-Dec-1960 12:00:00 UTC |
|
17 | - [ 25569, 'Pacific/Auckland', -43200 ], // 01-Jan-1970 00:00:00 NZST => 31-Dec-1969 12:00:00 UTC PHP Base Date |
|
18 | - [ 30292, 'Pacific/Auckland', 408020400 ], // 07-Dec-1982 00:00:00 NZDT => 06-Dec-1982 11:00:00 UTC |
|
19 | - [ 39611, 'Pacific/Auckland', 1213185600 ], // 12-Jun-2008 00:00:00 NZST => 11-Jun-2008 12:00:00 UTC |
|
20 | - [ 50423.5, 'Pacific/Auckland', 2147382000 ], // 18-Jan-2038 12:00:00 NZDT => 17-Jan-2038 23:00:00 UTC PHP 32-bit Latest Date |
|
21 | - [ 22345.56789, 'Pacific/Auckland', -278547734 ], // 05-Mar-1961 13:37:46 NZST => 05-Mar-1961 01:37:46 UTC |
|
22 | - [ 22345.6789, 'Pacific/Auckland', -278538143 ], // 05-Mar-1961 16:17:37 NZST => 05-Mar-1961 04:17:37 UTC |
|
23 | - [ 0.5, 'Pacific/Auckland', 0 ], // 12:00:00 NZST => 00:00:00 UTC |
|
24 | - [ 0.75, 'Pacific/Auckland', 21600 ], // 18:00.00 NZST => 06:00:00 UTC |
|
25 | - [ 0.12345, 'Pacific/Auckland', -32534 ], // 02:57:46 NZST => 14:57:46 UTC |
|
26 | - [ 41215, 'Pacific/Auckland', 1351767600 ], // 02-Nov-2012 00:00:00 NZDT => 01-Nov-2012 11:00:00 UTC |
|
5 | + [22269, 'America/New_York', -285102000], // 19-Dec-1960 00:00:00 EST => 19-Dec-1960 05:00:00 UTC |
|
6 | + [25569, 'America/New_York', 18000], // 01-Jan-1970 00:00:00 EST => 01-Jan-1970 05:00:00 UTC PHP Base Date |
|
7 | + [30292, 'America/New_York', 408085200], // 07-Dec-1982 00:00:00 EST => 07-Dec-1982 05:00:00 UTC |
|
8 | + [39611, 'America/New_York', 1213243200], // 12-Jun-2008 00:00:00 EDT => 12-Jun-2008 04:00:00 UTC |
|
9 | + [50424, 'America/New_York', 2147490000], // 19-Jan-2038 00:00:00 EST => 19-Jan-2038 05:00:00 UTC PHP 32-bit Latest Date |
|
10 | + [22345.56789, 'America/New_York', -278486534], // 05-Mar-1961 13:37:46 EST => 05-Mar-1961 18:37:46 UTC |
|
11 | + [22345.6789, 'America/New_York', -278476943], // 05-Mar-1961 16:17:37 EST => 05-Mar-1961 21:17:37 UTC |
|
12 | + [0.5, 'America/New_York', 61200], // 12:00:00 EST => 17:00:00 UTC |
|
13 | + [0.75, 'America/New_York', 82800], // 18:00.00 EST => 23:00:00 UTC |
|
14 | + [0.12345, 'America/New_York', 28666], // 02:57:46 EST => 07:57:46 UTC |
|
15 | + [41215, 'America/New_York', 1351828800], // 02-Nov-2012 00:00:00 EDT => 02-Nov-2012 04:00:00 UTC |
|
16 | + [22269, 'Pacific/Auckland', -285163200], // 19-Dec-1960 00:00:00 NZST => 18-Dec-1960 12:00:00 UTC |
|
17 | + [25569, 'Pacific/Auckland', -43200], // 01-Jan-1970 00:00:00 NZST => 31-Dec-1969 12:00:00 UTC PHP Base Date |
|
18 | + [30292, 'Pacific/Auckland', 408020400], // 07-Dec-1982 00:00:00 NZDT => 06-Dec-1982 11:00:00 UTC |
|
19 | + [39611, 'Pacific/Auckland', 1213185600], // 12-Jun-2008 00:00:00 NZST => 11-Jun-2008 12:00:00 UTC |
|
20 | + [50423.5, 'Pacific/Auckland', 2147382000], // 18-Jan-2038 12:00:00 NZDT => 17-Jan-2038 23:00:00 UTC PHP 32-bit Latest Date |
|
21 | + [22345.56789, 'Pacific/Auckland', -278547734], // 05-Mar-1961 13:37:46 NZST => 05-Mar-1961 01:37:46 UTC |
|
22 | + [22345.6789, 'Pacific/Auckland', -278538143], // 05-Mar-1961 16:17:37 NZST => 05-Mar-1961 04:17:37 UTC |
|
23 | + [0.5, 'Pacific/Auckland', 0], // 12:00:00 NZST => 00:00:00 UTC |
|
24 | + [0.75, 'Pacific/Auckland', 21600], // 18:00.00 NZST => 06:00:00 UTC |
|
25 | + [0.12345, 'Pacific/Auckland', -32534], // 02:57:46 NZST => 14:57:46 UTC |
|
26 | + [41215, 'Pacific/Auckland', 1351767600], // 02-Nov-2012 00:00:00 NZDT => 01-Nov-2012 11:00:00 UTC |
|
27 | 27 | ]; |
@@ -2,18 +2,18 @@ |
||
2 | 2 | |
3 | 3 | // Excel DateTimeStamp Result Comments |
4 | 4 | return [ |
5 | - [ 714, -2147472000 ], // PHP 32-bit Earliest Date 14-Dec-1901 |
|
6 | - [ 1461, -2082931200 ], // 31-Dec-1903 |
|
7 | - [ 1462, -2082844800 ], // Excel 1904 Calendar Base Date 01-Jan-1904 |
|
8 | - [ 1463, -2082758400 ], // 02-Jan-1904 |
|
9 | - [ 22269, -285120000 ], // 19-Dec-1960 |
|
10 | - [ 25569, 0 ], // PHP Base Date 01-Jan-1970 |
|
11 | - [ 30292, 408067200 ], // 07-Dec-1982 |
|
12 | - [ 39611, 1213228800 ], // 12-Jun-2008 |
|
13 | - [ 50424, 2147472000 ], // PHP 32-bit Latest Date 19-Jan-2038 |
|
14 | - [ 1234.56789, -2102494934 ], // 18-May-1903 13:37:46 |
|
15 | - [ 12345.6789, -1142494943 ], // 18-Oct-1933 16:17:37 |
|
16 | - [ 0.5, 43200 ], // 12:00:00 |
|
17 | - [ 0.75, 64800 ], // 18:00.00 |
|
18 | - [ 0.12345, 10666 ], // 02:57:46 |
|
5 | + [714, -2147472000], // PHP 32-bit Earliest Date 14-Dec-1901 |
|
6 | + [1461, -2082931200], // 31-Dec-1903 |
|
7 | + [1462, -2082844800], // Excel 1904 Calendar Base Date 01-Jan-1904 |
|
8 | + [1463, -2082758400], // 02-Jan-1904 |
|
9 | + [22269, -285120000], // 19-Dec-1960 |
|
10 | + [25569, 0], // PHP Base Date 01-Jan-1970 |
|
11 | + [30292, 408067200], // 07-Dec-1982 |
|
12 | + [39611, 1213228800], // 12-Jun-2008 |
|
13 | + [50424, 2147472000], // PHP 32-bit Latest Date 19-Jan-2038 |
|
14 | + [1234.56789, -2102494934], // 18-May-1903 13:37:46 |
|
15 | + [12345.6789, -1142494943], // 18-Oct-1933 16:17:37 |
|
16 | + [0.5, 43200], // 12:00:00 |
|
17 | + [0.75, 64800], // 18:00.00 |
|
18 | + [0.12345, 10666], // 02:57:46 |
|
19 | 19 | ]; |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | // Unix TimeStamp Result Comments |
4 | 4 | return [ |
5 | - [ -2147472000, 714 ], // PHP 32-bit Earliest Date 14-Dec-1901 |
|
6 | - [ -2082931200, 1461 ], // 31-Dec-1903 |
|
7 | - [ -2082844800, 1462 ], // Excel 1904 Calendar Base Date 01-Jan-1904 |
|
8 | - [ -2082758400, 1463 ], // 02-Jan-1904 |
|
9 | - [ -285120000, 22269 ], // 19-Dec-1960 |
|
10 | - [ 0, 25569 ], // PHP Base Date 01-Jan-1970 |
|
11 | - [ 408067200, 30292 ], // 07-Dec-1982 |
|
12 | - [ 1213228800, 39611 ], // 12-Jun-2008 |
|
13 | - [ 2147472000, 50424 ], // PHP 32-bit Latest Date 19-Jan-2038 |
|
14 | - [ -2102494934, 1234.56789 ], // 18-May-1903 13:37:46 |
|
15 | - [ -1142494943, 12345.6789 ], // 18-Oct-1933 16:17:37 |
|
5 | + [ -2147472000, 714], // PHP 32-bit Earliest Date 14-Dec-1901 |
|
6 | + [ -2082931200, 1461], // 31-Dec-1903 |
|
7 | + [ -2082844800, 1462], // Excel 1904 Calendar Base Date 01-Jan-1904 |
|
8 | + [ -2082758400, 1463], // 02-Jan-1904 |
|
9 | + [ -285120000, 22269], // 19-Dec-1960 |
|
10 | + [0, 25569], // PHP Base Date 01-Jan-1970 |
|
11 | + [408067200, 30292], // 07-Dec-1982 |
|
12 | + [1213228800, 39611], // 12-Jun-2008 |
|
13 | + [2147472000, 50424], // PHP 32-bit Latest Date 19-Jan-2038 |
|
14 | + [ -2102494934, 1234.56789], // 18-May-1903 13:37:46 |
|
15 | + [ -1142494943, 12345.6789], // 18-Oct-1933 16:17:37 |
|
16 | 16 | ]; |
@@ -2,40 +2,40 @@ |
||
2 | 2 | |
3 | 3 | // Excel Format Code Result |
4 | 4 | return [ |
5 | - [ 'General', FALSE ], |
|
6 | - [ '@', FALSE ], |
|
7 | - [ '0', FALSE ], |
|
8 | - [ '0.00', FALSE ], |
|
9 | - [ '#,##0.00', FALSE ], |
|
10 | - [ '#,##0.00_-', FALSE ], |
|
11 | - [ '0%', FALSE ], |
|
12 | - [ '0.00%', FALSE ], |
|
13 | - [ 'yyyy-mm-dd', TRUE ], |
|
14 | - [ 'yy-mm-dd', TRUE ], |
|
15 | - [ 'dd/mm/yy', TRUE ], |
|
16 | - [ 'd/m/y', TRUE ], |
|
17 | - [ 'd-m-y', TRUE ], |
|
18 | - [ 'd-m', TRUE ], |
|
19 | - [ 'm-y', TRUE ], |
|
20 | - [ 'mm-dd-yy', TRUE ], |
|
21 | - [ 'd-mmm-yy', TRUE ], |
|
22 | - [ 'd-mmm', TRUE ], |
|
23 | - [ 'mmm-yy', TRUE ], |
|
24 | - [ 'm/d/yy h:mm', TRUE ], |
|
25 | - [ 'd/m/y h:mm', TRUE ], |
|
26 | - [ 'h:mm AM/PM', TRUE ], |
|
27 | - [ 'h:mm:ss AM/PM', TRUE ], |
|
28 | - [ 'h:mm', TRUE ], |
|
29 | - [ 'h:mm:ss', TRUE ], |
|
30 | - [ 'mm:ss', TRUE ], |
|
31 | - [ 'h:mm:ss', TRUE ], |
|
32 | - [ 'i:s.S', TRUE ], |
|
33 | - [ 'h:mm:ss;@', TRUE ], |
|
34 | - [ 'yy/mm/dd;@', TRUE ], |
|
35 | - [ '"$" #,##0.00_-', FALSE ], |
|
36 | - [ '$#,##0_-', FALSE ], |
|
37 | - [ '[$EUR ]#,##0.00_-', FALSE ], |
|
38 | - [ '_[$EUR ]#,##0.00_-', FALSE ], |
|
39 | - [ '[Green]#,##0.00;[Red]#,##0.00_-', FALSE ], |
|
40 | - [ '#,##0.00 "dollars"', FALSE ], |
|
5 | + ['General', FALSE], |
|
6 | + ['@', FALSE], |
|
7 | + ['0', FALSE], |
|
8 | + ['0.00', FALSE], |
|
9 | + ['#,##0.00', FALSE], |
|
10 | + ['#,##0.00_-', FALSE], |
|
11 | + ['0%', FALSE], |
|
12 | + ['0.00%', FALSE], |
|
13 | + ['yyyy-mm-dd', TRUE], |
|
14 | + ['yy-mm-dd', TRUE], |
|
15 | + ['dd/mm/yy', TRUE], |
|
16 | + ['d/m/y', TRUE], |
|
17 | + ['d-m-y', TRUE], |
|
18 | + ['d-m', TRUE], |
|
19 | + ['m-y', TRUE], |
|
20 | + ['mm-dd-yy', TRUE], |
|
21 | + ['d-mmm-yy', TRUE], |
|
22 | + ['d-mmm', TRUE], |
|
23 | + ['mmm-yy', TRUE], |
|
24 | + ['m/d/yy h:mm', TRUE], |
|
25 | + ['d/m/y h:mm', TRUE], |
|
26 | + ['h:mm AM/PM', TRUE], |
|
27 | + ['h:mm:ss AM/PM', TRUE], |
|
28 | + ['h:mm', TRUE], |
|
29 | + ['h:mm:ss', TRUE], |
|
30 | + ['mm:ss', TRUE], |
|
31 | + ['h:mm:ss', TRUE], |
|
32 | + ['i:s.S', TRUE], |
|
33 | + ['h:mm:ss;@', TRUE], |
|
34 | + ['yy/mm/dd;@', TRUE], |
|
35 | + ['"$" #,##0.00_-', FALSE], |
|
36 | + ['$#,##0_-', FALSE], |
|
37 | + ['[$EUR ]#,##0.00_-', FALSE], |
|
38 | + ['_[$EUR ]#,##0.00_-', FALSE], |
|
39 | + ['[Green]#,##0.00;[Red]#,##0.00_-', FALSE], |
|
40 | + ['#,##0.00 "dollars"', FALSE], |
|
41 | 41 | ]; |
@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | // Excel DateTimeStamp Result |
4 | 4 | return [ |
5 | - [ -1956528000, 1462 ], |
|
6 | - [ -1956441600, 1463 ], |
|
7 | - [ -158803200, 22269 ], |
|
8 | - [ 126316800, 25569 ], |
|
9 | - [ 534384000, 30292 ], |
|
10 | - [ 1339545600, 39611 ], |
|
5 | + [ -1956528000, 1462], |
|
6 | + [ -1956441600, 1463], |
|
7 | + [ -158803200, 22269], |
|
8 | + [126316800, 25569], |
|
9 | + [534384000, 30292], |
|
10 | + [1339545600, 39611], |
|
11 | 11 | ]; |