Jump to content

Date minus 1 month


NLCJ

Recommended Posts

Hello,

I've been struggling for days on this problem now. And I'm getting frustrated!  >:( I know that the answer is simple, and I've done it before but I cannot figure out what I'm doing wrong.

What do I want?

Well, I get a date from the database in this format: YYYY-MM-DD. I first want to distract one month from that and then set in into this form: YYYY, MM, DD. I've got this but it's not working (I've tried a lot different values).

$transformdate = date("Y-m-d", strtotime("-1 month", $d_datevalue)); 
$startpoint = str_replace("-", ", ", $transformdate);

 

Thanks,

NLCJ

Link to comment
https://forums.phpfreaks.com/topic/214098-date-minus-1-month/
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.