View Full Version : date and timestamps

11-20-2007, 03:44 PM
Hey guys.

I need to get the days current date, and then i need to add +7 days to it. How would i go about doing that in PHP?

And also, when storing it in a database, what type should it be? Datetime?


11-20-2007, 03:57 PM
$timePlusOneWeek = time() + (3600 * 24 * 7);

And yes, DATETIME would be a good way of storing a date+time.

11-20-2007, 05:25 PM
strtotime('+1 week');

11-20-2007, 05:26 PM
Well, I suppose that works too... ;) (I like mine better though!)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum