How do I correctly store time over 24 hours in CakePHP?

I would like to store a period of time (20 minutes, 3 hours, 76 hours and 20 minutes...) with CakePHP. What would be the appropriate way to do so? If I use MySQL's TIME format, it's not necessarily database cross compatible, plus Cake expects it to be a time of day, with am/pm or 24 hour formatting.

Is the only option just to store it in seconds as an int and do the data crunch myself?

Thanks!

Answers


strtotime() method can help you to store time in UNIX timestamp format into the database. That you can easily use it later using mktime() method.


Need Your Help

How to detect and debug stale cache entries?

php debugging caching memcached

I am using memcached with PHP trying for heavy caching to avoid db-reads. I am invalidating the cache on an update (application invalidates). But, stale cache data is becoming a big issue. Mostly, ...

How do I call a vbs script from Inno Setup script with cscript and vbs arguments?

iis iis-6 inno-setup wsh

The following is an entry I'm using to attempt to create a virtual directory in IIS 6: