Adding a relative amount of time to an absolute time.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

This sort of stuff always makes me wonder what it is I am missing.

The users are asked to enter a buffer time in the format HH:MM

This time will be added to the end of an event datetime to determine what
the next available event will be for that user.

The entered value is stored in the DB as a time type (so is returned as a
string "HH:MM:SS").

Can I use anything in DateTime to handle this (I was thinking of
DateTimeInterval but that doesn't want to deal with a simple time only
string).

My other option is to parse out the string into H, M and S and then
construct that as a strtotime sort of thing.

In general, this sort of parsing always suggests I've missed a
trick/function/method.

So, is there something I'm missing?

Regards,

Richard.



-- 
Richard Quadling
Twitter : @RQuadling
EE : http://e-e.com/M_248814.html
Zend : http://bit.ly/9O8vFY

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux