Help me with dates please!!!

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
b4m
Forum Newbie
Posts: 2
Joined: Mon Apr 19, 2004 5:12 am

Help me with dates please!!!

Post by b4m »

I need to subtract a number of days from a specific day.

i.e from Mon 04/19/1996 i need to subtract 8 days

Can anyone please help me do so?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Code: Select all

//Create a timestamp for 04/19/1996 using mktime and store in $date

//then simply do the following
echo date("d/m/Y", strtotime("-8 days", $date));
Mark
b4m
Forum Newbie
Posts: 2
Joined: Mon Apr 19, 2004 5:12 am

Thank U

Post by b4m »

Thanks for help
Post Reply