On Jan 7, 6:35 pm, "jitka (poLK)" <[email protected]> wrote:
> Answer for display of correct date/time is 
> here:http://api.cakephp.org/search.php?query=userOffset
>
> Scaffolding doesn't use TimeHelper.

Thanks jitka,

After a bit more of exploration/trial and error, I probably will use
the following methods:
1. Use timestamp for all 'significant' date fields (I'm using mysql)
2. Override in TZ environment variable and database session timezone
in app_controller.php within
   beforeFilter(), ie:

   putenv('TZ=Asia/Jakarta');
   $model->query("set session time_zone='Asia/Jakarta'");

Using this method, Scaffolding will display the converted time as
well.

However, can anyone confirm that AppController->beforeFilter is the
correct place to do this?

For anyone who want to dig more: http://www.sjhannah.com/blog/?p=113
explains a whole lot more.

Note: If you want to use named timezone in the 'set session time_zone'
statement, you'll need to import the data to mysql, either via
mysql_tzinfo_to_sql utility, or provided data files from
http://dev.mysql.com/downloads/timezones.html . Otherwise, you'll need
to use offset format, eg: '+07:00'.

Thanks,
- RC

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to