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? Quote 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. Quote 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(); Quote 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 Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.