Jump to content


Date


1 reply to this topic

#1 liveman

    Young Padawan

  • Members
  • Pip
  • 246 posts
  • Location:New Jersey

Posted 01 July 2006 - 07:27 PM

Ok, well I am creating a premium account system. How it works is the user says how many months they want and gets the price, then it takes todays date adds the months and gets when it is over. To do that i use:

  $date = mktime(0,0,0,date("m")+$_POST['m'], date("d"), date("y"));
		   $d = date("l F d,Y", $date);
		   echo $d;

The problem is if the user is topping off their account it would get rid of what they had. For example:

Saturday July 1, 2006 -- Todays date
Tuesday August 1, 2006 -- when my account would expire
so I decide to add 3 months to it, I want
Wednesday Novemember 1, 2006 not Saturday October 1, 2006

Any suggestions?

--
Thanks in Advance

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 02 July 2006 - 11:53 AM

Don't know anything about mktime, but you could try strtotime()





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users