MCPcopy Create free account
hub / github.com/Rello/analytics / convertGermanDateFormat

Method convertGermanDateFormat

lib/Service/StorageService.php:321–334  ·  view source on GitHub ↗
($val)

Source from the content-addressed store, hash-verified

319 }
320
321 private function convertGermanDateFormat($val) {
322 if ($val !== null) {
323 $fullString = explode(' ', $val);
324 $dateLength = strlen($fullString[0]);
325 $dateParts = explode('.', $fullString[0]);
326
327 if ($dateLength >= 6 && $dateLength <= 10 && count($dateParts) === 3) {
328 // is most likely a german date format 20.02.2020
329 $fullString[0] = $dateParts[2] . '-' . sprintf('%02d', $dateParts[1]) . '-' . sprintf('%02d', $dateParts[0]);
330 $val = implode(' ', $fullString);
331 }
332 }
333 return $val;
334 }
335}

Callers 1

updateMethod · 0.95

Calls 1

countFunction · 0.50

Tested by

no test coverage detected