Jump to content

[SOLVED] making a date from strtotime


shadiadiph

Recommended Posts

how do i make strtotime number back into a date Y-m-d?

 

i have tried this but it doesn't work?

 

i am tring to make the date that is 3 days before now to use in an sql statement but can't seem to get it right. 259200 is the right amount of seconds problem is with the mktime

 

$today = date('Y-m-d');
$todayintime = strtotime($today);
$wantedlog = ($todayintime - 259200);
$newtime = strftime("%Y-%m-%d",mktime(0,0,0,$wantedlog));
print $newtime;

Link to comment
https://forums.phpfreaks.com/topic/151707-solved-making-a-date-from-strtotime/
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.