jakebur01 Posted February 27, 2009 Share Posted February 27, 2009 How can I get like 12:01 AM and 11:59 PM of today using unix timestamp? Link to comment https://forums.phpfreaks.com/topic/147202-solved-getting-start-and-end-of-day/ Share on other sites More sharing options...
wildteen88 Posted February 27, 2009 Share Posted February 27, 2009 Do you want to format a unix timestamp to a 12 hour format? have a look at the date function. Link to comment https://forums.phpfreaks.com/topic/147202-solved-getting-start-and-end-of-day/#findComment-772732 Share on other sites More sharing options...
jakebur01 Posted February 27, 2009 Author Share Posted February 27, 2009 This is an example of what I have going. I was using the code below and pulling my start and end times from a database. Now I am no longer doing that, so I want to make the starttime today at 12 AM and the endtime tonight at 11:59 PM $te = date("Y-m-d H:i:s", $meetingstarttime); $secondsDiff = $meetingstarttime - time(); $tr = date("Y-m-d H:i:s", $meetingendtime); $secondsDiffr = $meetingendtime - time(); Link to comment https://forums.phpfreaks.com/topic/147202-solved-getting-start-and-end-of-day/#findComment-772734 Share on other sites More sharing options...
samshel Posted February 27, 2009 Share Posted February 27, 2009 mktime(0, 0, 1, date("n"), date("j") , date("Y"));//Start of day 12:01 AM mktime(23, 59, 59, date("n"), date("j") , date("Y"));//Start of day 11:59:59 PM Link to comment https://forums.phpfreaks.com/topic/147202-solved-getting-start-and-end-of-day/#findComment-772737 Share on other sites More sharing options...
jakebur01 Posted February 27, 2009 Author Share Posted February 27, 2009 that got it. Thank you. Link to comment https://forums.phpfreaks.com/topic/147202-solved-getting-start-and-end-of-day/#findComment-772740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.