Reputation: 1456
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!
Upvotes: 1
Views: 379
Reputation: 5464
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.
Upvotes: 1