dc_jt Posted March 21, 2007 Share Posted March 21, 2007 Im looking to get the date of a week before a certain date For example $iLastDate = date("Y-m-d H:i:s "); $timeStamp = strtotime($iLastDate); $timeStamp += 24 * 60 * 60 * 7; $NextBatchDate = date("Y-m-d H:i:s", $timeStamp); This is for a week ahead, how do I do a week before? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/43654-solved-date-function-for-week-before/ Share on other sites More sharing options...
Orio Posted March 21, 2007 Share Posted March 21, 2007 Change += to -= Orio. Quote Link to comment https://forums.phpfreaks.com/topic/43654-solved-date-function-for-week-before/#findComment-211923 Share on other sites More sharing options...
dc_jt Posted March 21, 2007 Author Share Posted March 21, 2007 Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/43654-solved-date-function-for-week-before/#findComment-211928 Share on other sites More sharing options...
jitesh Posted March 21, 2007 Share Posted March 21, 2007 $iLastDate = date("Y-m-d H:i:s "); $timeStamp = strtotime($iLastDate); $timeStamp -= 24 * 60 * 60 * 7; $NextBatchDate = date("Y-m-d H:i:s", $timeStamp); Quote Link to comment https://forums.phpfreaks.com/topic/43654-solved-date-function-for-week-before/#findComment-211935 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.