Fix date parsing error
This commit is contained in:
parent
c4a5a09205
commit
a142f9fdfb
|
@ -283,10 +283,14 @@ class Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function formatTimestamp($datestamp) {
|
private function formatTimestamp($datestamp) {
|
||||||
if (is_array($time = date_parse_from_format('Y-m-d\TH:i:s\Z', $datestamp)) || is_array($time = date_parse_from_format('Y-m-d\TH:i:s\Z', $datestamp))) {
|
$time = date_parse_from_format('Y-m-d\TH:i:s\Z', $datestamp);
|
||||||
return gmmktime($time['hour'], $time['minute'], $time['second'], $time['month'] + 1, $time['day'], $time['year']);
|
if ($time['error_count'] > 0) {
|
||||||
} else {
|
$time = date_parse_from_format('Y-m-d', $datestamp);
|
||||||
|
}
|
||||||
|
if ($time['error_count'] > 0) {
|
||||||
return null;
|
return null;
|
||||||
|
} else {
|
||||||
|
return gmmktime($time['hour'], $time['minute'], $time['second'], $time['month'] + 1, $time['day'], $time['year']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue