Jump to content

[SOLVED] Time Function


stormx

Recommended Posts

To get the date 2 days ago, use strtotime():

 

<?php
$now = date('Y-m-d');
$past = date('Y-m-d', strtotime("$now - 2 days"));
?>

 

Or simply

 

<?php
$past = date('Y-m-d', strtotime('- 2 days'));
?>

 

if I'm right..

 

I don't know about cron in cPanel.

Link to comment
https://forums.phpfreaks.com/topic/122375-solved-time-function/#findComment-631861
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.