Jump to content

Time and how to add/subtract it.


Perad

Recommended Posts

PHP's time functions return times based on the time of the server.

About subtracting and adding to time:
If you use time() just do it like regular calculations with + or -
If you use a formatted time stamp you can use [url=http://php.net/strtotime]strtotime()[/url]
MySQL has it's own time and date functions that can store the current time and date in any common format.

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

If you're storing your dates/times in MySQL, it's best to use this stuff, rather than overly complexing it with PHP code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.