PHP timestamp Issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
asj
Forum Newbie
Posts: 1
Joined: Fri Jan 21, 2005 3:27 pm

PHP timestamp Issue

Post by asj »

I have a timestamp which is being added to the database like " 2004-11-11 16:30:20" and I need to add 3 hours to it, and format it to something more ledgable like November 11, 2004 - 4:30:20.

Can someone please help me out with this please.

Thanks.

Aaron Jorgensen
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

if php generates the timestamp, then you can use strtotime('+3 hours') or similar for 3 hrs from now.

If mysql is generating the timestamp there are a number of ways. Read through the functions and code featured here: http://dev.mysql.com/doc/mysql/en/Date_ ... tions.html
Post Reply