stormx Posted September 2, 2008 Share Posted September 2, 2008 Hello, With PHP time, I was wondering if their is a script to get the date of the day before yesterday, thats for the date and month. Also off the topic, but does anyone know the complete configuration of getting a cron to run on the 1st second of the month in cPanel? Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/122375-solved-time-function/ Share on other sites More sharing options...
thebadbad Posted September 2, 2008 Share Posted September 2, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/122375-solved-time-function/#findComment-631861 Share on other sites More sharing options...
stormx Posted September 2, 2008 Author Share Posted September 2, 2008 Thanks thebadbad, Worked great:) Quote Link to comment https://forums.phpfreaks.com/topic/122375-solved-time-function/#findComment-631868 Share on other sites More sharing options...
Zane Posted September 2, 2008 Share Posted September 2, 2008 here's you some crontab literature http://www.adminschoice.com/docs/crontab.htm Quote Link to comment https://forums.phpfreaks.com/topic/122375-solved-time-function/#findComment-631877 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.