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 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. 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 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); 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
Archived
This topic is now archived and is closed to further replies.