Re: Daylight Saving Time (DST) in cakephp

2011-11-21 Thread euromark
looks interesting that's where a behavior would come in handy (behaving as I described above). it would automate this process On 21 Nov., 09:25, Chris Cinelli wrote: > PHP 5.2+ has the functions to work on date and they automatically take care > of all the math for DST. > Our solution is current

Re: Daylight Saving Time (DST) in cakephp

2011-11-21 Thread Chris Cinelli
PHP 5.2+ has the functions to work on date and they automatically take care of all the math for DST. Our solution is currently to run the servers in GMT. We set the default timezone to GMT in bootstrap.php We have also 2 functions in the AppController: public function toLocalTime($time) {

Re: Daylight Saving Time (DST) in cakephp

2011-11-18 Thread euromark
right you would have to convert it back again of course find() => behavior converts all to local time save() => behavior converts all to UTC (cake inserts new dates in UTC anyway) probably quite some overhead but it should keep it clean. as of right now I simply set the timezone fixed to LONDON/

Re: Daylight Saving Time (DST) in cakephp

2011-11-04 Thread Jeremy Burns | Class Outfit
I was thinking of the new key to display a localised version, but keep the old one for editing; if you just convert it and then save the record it'd save the 'local' version, wouldn't it? Jeremy Burns Class Outfit http://www.classoutfit.com On 4 Nov 2011, at 13:32, euromark wrote: > probably

Re: Daylight Saving Time (DST) in cakephp

2011-11-04 Thread euromark
probably i wouldt apply new keys then, just override the old ones. if you don't change the current keys your forms will have to be modified. There is no jack of all trades device for this, i guess. setting the default_time_zone to your location only fixes the dtc problem for this specific country

Re: Daylight Saving Time (DST) in cakephp

2011-11-04 Thread Jeremy Burns | Class Outfit
Couldn't you do an afterFind in a behaviour that sets new keys like 'LocalTime'? Jeremy Burns Class Outfit http://www.classoutfit.com On 4 Nov 2011, at 13:04, euromark wrote: > maybe you can adopt some of this > https://raw.github.com/jellehenkens/lemon_utils/master/View/Helper/TimeMachineHelpe

Re: Daylight Saving Time (DST) in cakephp

2011-11-04 Thread euromark
maybe you can adopt some of this https://raw.github.com/jellehenkens/lemon_utils/master/View/Helper/TimeMachineHelper.php I am wondering: How do you guys handle the daylight saving time issue? Currently we face this problem in 2.0: - dates (created, modified, own ones) are saved without it (-1 hou

Re: Daylight Saving Time (DST) in cakephp

2011-10-28 Thread Ryan Schmidt
On Oct 26, 2011, at 01:25, Shanaka wrote: > I'm creating a web application using cakephp 1.2.6. Why would you use 1.2.x to create a new web app, and not 2.0? Even using 1.3.x would be better but I don't see why you wouldn't start with the latest and greatest. Converting your app later to use

Daylight Saving Time (DST) in cakephp

2011-10-26 Thread Shanaka
I'm creating a web application using cakephp 1.2.6. There is a functionality that I need to save the time that user is entered in GMT format. I'm using below method to do this. function convertDateTimeToGMT($dateTimeStr,$fromTimeZone, $format = 'Y- m-d H:i:s') { if (empty($dateTimeStr)) re