Created
January 14, 2019 14:15
-
-
Save Asinox/c10830513324f525972a4bf7c122e107 to your computer and use it in GitHub Desktop.
Apply local timezone to OctoberCMS backend list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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