quick question

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
frenchwr
Forum Newbie
Posts: 1
Joined: Sun Mar 29, 2009 9:43 pm

quick question

Post by frenchwr »

I am reletively new to php and i have code that simply returns the server time as I need it to put it in an sql database

$cst = date('Y-m-d H:i:s');

how can i print off the time 168 hours(7 days later)?

does the MKtime function do this?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: quick question

Post by requinix »

mktime can do it, but strtotime is much easier to use.

If you want 168 hours then use that, because there will be a difference between it and "7 days" during two certain periods of the year...
Post Reply