timestamp or date?

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
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

timestamp or date?

Post by pleigh »

hi there,

in a forum-like page, what do you guys recommend to use to track the dates of logins and posts?timestamp or date?

thanks.

pleigh
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

datetime.
timestamp will automatically update the time if you update any other field in the table. Therefore if you dont want the time to be updated each time you update a row, then you'll need to manually set the timestamp filed to NOW().
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I prefer binary timestamps i.e. int(11) .. basicaly stored unix-timestamp, versus the database's versions.. but I write for multiple architectures.. so...
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

ok...thanks very much for your help guys
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Yes, i would also agree with feyd on using the UNIX timestamp
Post Reply