Date/time changes

Development related discussion.
Post Reply
User avatar
Advanced Member
Posts: 666
Joined: Fri Mar 27, 2009 7:37 pm
Location: Australia

Date/time changes

Post by Jack » Sun Oct 02, 2011 6:54 pm

Avalon (the framework) has a new feature to deal with date and time, which greatly affects how time is handled in Traq 3.0.

The database no longer stores unix timetamps, instead all dates and times will be stored in the "2011-12-25 5:55:55" format, in GMT time.

If you would like to change the time back to local time, use the new Time helper function to do so, Time::gmtToLocal($datetime).

The model class attempts to automatically convert the date/time to local time via the after filters, however this is only for the created_at, updated_at and published_at fields, but you can always add your own by overwriting the _date_time_convert method in the model class, for example:

Code: Select all

class Ticket extends Model


    public function _date_time_convert()



        $this->my_date_time = Time::gmtToLocal($this->my_date_time);



Last edited by Jack on Sun Oct 02, 2011 6:55 pm, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest