Jump to content

[SOLVED] Previous Date Issue


ainoy31

Recommended Posts

Hello-

 

I am having an issue trying to figure out the beginning of the previous month.  I am doing a previous billing cycle feature where I display three previous billing cycle from current date.  This is what I am using to go back three months.

 

$previousThreeBillCycle = mktime(0, 0, 0, date("m")-3, date("d"), date("Y"));
$previousMonth = date("Y-m-d", $previousThreeBillCycle);

 

That gets me the date of 2008-05-08.  I know that the bill start date is on the first of every month and it is a monthly plan.  I can't seem to think through the logic for this.  Much appreciation.  I hope this is clear enough.  AM

Link to comment
https://forums.phpfreaks.com/topic/118846-solved-previous-date-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.