Skip to content

Instantly share code, notes, and snippets.

@Asinox
Created January 14, 2019 14:15
Show Gist options
  • Save Asinox/c10830513324f525972a4bf7c122e107 to your computer and use it in GitHub Desktop.
Save Asinox/c10830513324f525972a4bf7c122e107 to your computer and use it in GitHub Desktop.
Apply local timezone to OctoberCMS backend list
public function listOverrideColumnValue($record, $columnName, $definition) {
if ($columnName == 'created_at') {
// apply local timezone
$createdAt = (new \DateTime($record->created_at))->setTimezone(new \DateTimeZone('America/Santo_Domingo'));
return $createdAt->format('d/m/Y g:ia');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment