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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.