storing current date on database

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
fael097
Forum Commoner
Posts: 34
Joined: Sat Mar 06, 2010 7:57 pm

storing current date on database

Post by fael097 »

hi, once i read about a way to store the current date on database (the value on DB looked like "1267980827"), so you could retrieve this numbers with the date() function, and it would return the full format date.
what should i insert on my database to store this kind of value? thanks
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: storing current date on database

Post by Jonah Bron »

That column would be type Int. To INSERT that value into the table, use the value returned by time().
fael097
Forum Commoner
Posts: 34
Joined: Sat Mar 06, 2010 7:57 pm

Re: storing current date on database

Post by fael097 »

that helps a lot!
thank you! :D
Post Reply