Timestamp math and format
| From: | Alfredeen Johan K | Date: | Wed, 17 Oct 2001 16:01:09 +0000 |
| Subject: | Timestamp math and format | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-71351@lists.php.net to get a copy of this message | ||
I store a timestamp in a database of when a record was inserted. When I pull
it out, I format it like this SELECT DATE_FORMAT(insert_date,'%b %e (%r)')
AS idate
Now I would like to subtract 2 hours from the hour part of the timestamp.
What's the easiest way to do this, before or after the formatting? In PHP or
mySQL function? Can someone give me some code of how they would do this.
Thanks,
Johan