TZ changes

This commit is contained in:
2025-03-31 08:29:59 +00:00
parent 07cb5d1419
commit ca28f490eb
5 changed files with 65 additions and 52 deletions

View File

@@ -47,9 +47,10 @@ foreach ($payload['data'] as $key => $field) {
$columns[] = $columnMapping[$name];
$value = $field['value'];
// Transform ETA and ETD to MySQL datetime format
// Transform ETA and ETD to MySQL datetime format in UTC
if ($name == "ETA" || $name == "ETD") {
$date = DateTime::createFromFormat('d/m/Y H:i', $value);
$date = DateTime::createFromFormat('d/m/Y H:i', $value, new DateTimeZone('Europe/London'));
$date->setTimezone(new DateTimeZone('UTC')); // Convert to UTC
$value = $date->format('Y-m-d H:i:s');
}