writer Posted May 8, 2008 Share Posted May 8, 2008 I'm having a lot of trouble wrapping my head around PHP's mktime function. I've got a a few difficult tasks (for example, pull all records filed on a Tuesday this year) and was wondering if there's a class library out there somewhere that can cut down my development time. Anyone know of an easier way to work with unix timestamps in PHP? Link to comment https://forums.phpfreaks.com/topic/104663-is-there-an-easier-way-to-work-with-unix-timestamps/ Share on other sites More sharing options...
writer Posted May 8, 2008 Author Share Posted May 8, 2008 Followup: I can figure out Tuesday (find current Tuesday and count back) ... but can anyone help me figure out how to establish the first and last day's of the month? Link to comment https://forums.phpfreaks.com/topic/104663-is-there-an-easier-way-to-work-with-unix-timestamps/#findComment-535707 Share on other sites More sharing options...
mrdamien Posted May 8, 2008 Share Posted May 8, 2008 can anyone help me figure out how to establish the first and last day's of the month? <?php $num = date("t"); //number of days in the month. $firstDayTime= mktime(0,0,0, date('n'), 1, date('Y')); // First day of the month $lastDayTime= mktime(0,0,0, date('n'), $num, date('Y')); // Last day of the month ?> Link to comment https://forums.phpfreaks.com/topic/104663-is-there-an-easier-way-to-work-with-unix-timestamps/#findComment-535711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.