2016-08-16 12:00:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Date String, Result
|
|
|
|
|
|
|
|
return [
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'25-Dec-1899',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'31-Dec-1899',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
1,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1-Jan-1900',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
59,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1900/2/28',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'29-02-1900',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'29th February 1900',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
61,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1900/3/1',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
713,
|
2017-01-23 05:49:10 +00:00
|
|
|
'13-12-1901',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
714,
|
2017-01-23 05:49:10 +00:00
|
|
|
'14-12-1901',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
1461,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1903/12/31',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
1462,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1-Jan-1904',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
1463,
|
2017-01-23 05:49:10 +00:00
|
|
|
'2nd-Jan-1904',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
22269,
|
2017-01-23 05:49:10 +00:00
|
|
|
'19-12-1960',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
25569,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1st January 1970',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
30292,
|
2017-01-23 05:49:10 +00:00
|
|
|
'7-Dec-1982',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39448,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1-1-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
50424,
|
2017-01-23 05:49:10 +00:00
|
|
|
'2038-01-19',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39601,
|
2017-01-23 05:49:10 +00:00
|
|
|
'2-6-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
39807,
|
2017-01-23 05:49:10 +00:00
|
|
|
'December 25th 2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39448,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1 Jan-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// MS Excel success or failure dependent on country settings
|
|
|
|
[
|
|
|
|
39813,
|
2017-01-23 05:49:10 +00:00
|
|
|
'12-31-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// PhpSpreadsheet tries to handle both US and UK formats, irrespective of country settings
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
39813,
|
2017-01-23 05:49:10 +00:00
|
|
|
'31-12-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// MS Excel success or failure dependent on country settings
|
|
|
|
[
|
|
|
|
39682,
|
2017-01-23 05:49:10 +00:00
|
|
|
'8/22/2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// PhpSpreadsheet tries to handle both US and UK formats, irrespective of country settings
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
39682,
|
2017-01-23 05:49:10 +00:00
|
|
|
'22/8/2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39682,
|
2017-01-23 05:49:10 +00:00
|
|
|
'22/8/08',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39682,
|
2017-01-23 05:49:10 +00:00
|
|
|
'22-AUG-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39501,
|
2017-01-23 05:49:10 +00:00
|
|
|
'2008/02/23',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39635,
|
2017-01-23 05:49:10 +00:00
|
|
|
'6-7-2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// MS Excel success or failure dependent on country settings
|
|
|
|
[
|
|
|
|
39141,
|
2017-01-23 05:49:10 +00:00
|
|
|
'28-2-2007',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// PhpSpreadsheet tries to handle both US and UK formats, irrespective of country settings
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
39141,
|
2017-01-23 05:49:10 +00:00
|
|
|
'2-28-2007',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// Should fail because it's an invalid date, but PhpSpreadsheet currently adjusts to 1-3-2007 - FIX NEEDED
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'29-2-2007',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
36161,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1/1/1999',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
19925,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1954-07-20',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
36029,
|
2017-01-23 05:49:10 +00:00
|
|
|
'22 August 98',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
39142,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1st March 2007',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'The 1st day of March 2007',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 01/01 of the current year
|
|
|
|
[
|
2019-01-01 06:48:07 +00:00
|
|
|
43466,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1 Jan',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 31/12 of the current year
|
|
|
|
[
|
2019-01-01 06:48:07 +00:00
|
|
|
43830,
|
2017-01-23 05:49:10 +00:00
|
|
|
'31/12',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// Excel reads as 1st December 1931, not 31st December in current year
|
|
|
|
[
|
|
|
|
11658,
|
2017-01-23 05:49:10 +00:00
|
|
|
'12/31',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 05/07 of the current year
|
|
|
|
[
|
2019-01-01 06:48:07 +00:00
|
|
|
43651,
|
2017-01-23 05:49:10 +00:00
|
|
|
'5-JUL',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 05/07 of the current year
|
|
|
|
[
|
2019-01-01 06:48:07 +00:00
|
|
|
43651,
|
2017-01-23 05:49:10 +00:00
|
|
|
'5 Jul',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
39783,
|
2017-01-23 05:49:10 +00:00
|
|
|
'12/2008',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
11963,
|
2017-01-23 05:49:10 +00:00
|
|
|
'10/32',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
11,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
true,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
false,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
1,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
12345,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
12,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
40221,
|
2017-01-23 05:49:10 +00:00
|
|
|
'12-Feb-2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40221,
|
2017-01-23 05:49:10 +00:00
|
|
|
'Feb-12-2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40221,
|
2017-01-23 05:49:10 +00:00
|
|
|
'February-12-2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40221,
|
2017-01-23 05:49:10 +00:00
|
|
|
'February 12 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
40227,
|
2017-01-23 05:49:10 +00:00
|
|
|
'18 Feb 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40254,
|
2017-01-23 05:49:10 +00:00
|
|
|
'17th 3rd 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40227,
|
2017-01-23 05:49:10 +00:00
|
|
|
'Feb 18th 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40210,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1st Feb 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40210,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1st-Feb-2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1me Fev 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40210,
|
2017-01-23 05:49:10 +00:00
|
|
|
'February 1st 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40211,
|
2017-01-23 05:49:10 +00:00
|
|
|
'2nd Feb 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'Second Feb 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'First August 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2016-08-16 14:24:47 +00:00
|
|
|
// MS Excel will fail with a #VALUE return, but PhpSpreadsheet can parse this date
|
2016-08-16 12:00:19 +00:00
|
|
|
[
|
|
|
|
40391,
|
2017-01-23 05:49:10 +00:00
|
|
|
'1st August 2010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
0,
|
2017-01-23 05:49:10 +00:00
|
|
|
'15:30:25',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
2018-07-22 18:17:04 +00:00
|
|
|
[
|
|
|
|
'#VALUE!',
|
|
|
|
'ABCDEFGHIJKMNOPQRSTUVWXYZ',
|
|
|
|
],
|
2016-08-16 12:00:19 +00:00
|
|
|
];
|