Reputation: 6509
I'd like to be able to store the following data inside a variable: 'Current Year-Current Month-10' (so i.e. 2013-9-10)
Currently, I'm using: echo date("Y-m-d");
But this (as expected) displays the current Day, not 10 as I need it to.
Any help with this would be great.
Upvotes: 0
Views: 61
Reputation: 160923
You just need to do:
echo date("Y-m-10");
If you want next month:
echo date('Y-m-10', strtotime('next month'));
Upvotes: 5
Reputation: 100195
if you mean you want to hard code 10, then you could do:
$date = date("Y-m")."-10";
Upvotes: 4