Although the API says it is an INT variable, it will also accept a
float.  Because CakePHP 1.2 is also PHP4 compatible, the class methods
can't explicitly define the input parameter type, so the only thing
telling you it must be an integer is the PHPDoc; however you may run
the risk of having odd issues if you eventually upgrade the core code
to PHP5 only when that time comes...I don't expect this would be your
largest problem at that time, but it's something to be mindful of.
The actual code for TimeHelper::convert is below:

function convert($serverTime, $userOffset) {
    $serverOffset = $this->serverOffset();
    $gmtTime = $serverTime - $serverOffset;
    $userTime = $gmtTime + $userOffset * (60*60);
    return $userTime;
}

As you can see, you very well could use a float here.

On May 3, 5:25 am, Miles J <mileswjohn...@gmail.com> wrote:
> Perhaps a decimal? -5.5 or -5.75
>
> On May 2, 6:36 pm, Turgs <timb....@gmail.com> wrote:
>
>
>
> > Hi
>
> > The TimeHelper's convert() function takes a userOffset parameter as an
> > integer (hours from GMT).
>
> > What do you do for locations that are not an *exact* hour from GMT?
> > Such as:
>
> >    * Mumbai, Maharashtra, India (UTC+5:30)
> >    * Kathmandu, Nepal (UTC+5:45)
> >    * Dhaka, Bangladesh (UTC+6)
> >    * Yangon, Myanmar (UTC+6:30)
> >    * Adelaide, Australia (UTC+9:30)
>
> > Thanks
> > Turgs- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to