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 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 Link to comment https://forums.phpfreaks.com/topic/242217-help-with-php-time/#findComment-1243884 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.