Tuesday, May 17, 2011

Re: calculating time-fields?

Thanks,

but I did use a time field so the time is stored as a hh:mm string.
Gladly a debug($this) helped me in some way
I did extract the date I needed
$this->data[model][timefield][hour]
$this->data[model][timefield][min]
and added some simple code to calculate the time between start and end
myselfe .. it worked fine :D

On May 17, 8:59 pm, dreamingmind <dreamingmin...@gmail.com> wrote:
> Michael,
>
> PHP has a great set of time tools
>
> http://us.php.net/manual/en/ref.datetime.php
>
> you can do math on your timestamps and format them any way you want
> with date().
>
> Look at strtotime() also.
>
> Dig in! Everything you need is sure to be at hand
>
> Regards,
> Don
>
> On May 17, 4:17 am, "miv...@mivogt.net" <miv...@mivogt.net> wrote:
>
>
>
>
>
>
>
> > HI group,
>
> > I need a bit of help please ... I am using a model with 2 fields of
> > the time type to store the time of start and end of a job hh:mm
> > format.
> > Now I would like to get the amount of minutes between StartTime and
> > EndTime to be stored in the duration field.
> > Is there a cake built in method to aclc the time difference or is
> > there an easy way to do so using php ...(as in ms excel I might use to
> > time fields and substract em from each other)
>
> > Thanks in advance
>
> > Michael

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate