...

View Full Version : date and timestamps



ole90
11-20-2007, 04: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?

Thanks

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


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

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum