gibigbig Posted July 17, 2011 Share Posted July 17, 2011 My project requires me to make sql queries based on the month you are currently in as well as the subsequent months months before this. Example: to get the month number in php you use $month_num = date("n"); and for the month before you use: $month_before - date("n") - 1; what i need is a way of converting the $month_before to epoch timestamps. so i can do make a sql query for all user's activity in that month. Please help Quote Link to comment https://forums.phpfreaks.com/topic/242217-help-with-php-time/ Share on other sites More sharing options...
teynon Posted July 17, 2011 Share Posted July 17, 2011 Example: echo date("U", strtotime("Today -1 month")); http://php.net/manual/en/function.date.php Quote Link to comment https://forums.phpfreaks.com/topic/242217-help-with-php-time/#findComment-1243884 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.