I spend a bit of time looking for the this piece of code while building time feature on a site this tutorial also helped Local time zones and locales
I spend a bit of time looking for the this piece of code while building time feature on a site this tutorial also helped Local time zones and locales
This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.
The sql 'set time_zone' ensures that all dates retrieved are in UTC time. If your MySql server has the time zone names installed then use 'UTC' instead of '+00:00'.
Copy the code at the end of this wiki for LocalTime.php and DefaultDateTimeParser.php int...