tibberous Posted May 13, 2009 Share Posted May 13, 2009 I need to ask the user for a start time and date, and then save it. Then I need to ask them how long they want something to show up. When someone visits the site, I need to make something show up if it is after the start time but still during the show time. I don't know whether I should try and use mysqls date and time functions, or if I should just use phps timestamps for everything and just put ints into the database. Link to comment https://forums.phpfreaks.com/topic/157973-dealing-with-times-and-dates/ Share on other sites More sharing options...
Ken2k7 Posted May 13, 2009 Share Posted May 13, 2009 Have a table with start_time and end_time. Both TIMESTAMP. The start_time is the time the user wants that thing to show up and the end_time is when it will stop. In the application, you don't have to make the user select an end_time, you can convert that using PHP before storing it in the DB. Link to comment https://forums.phpfreaks.com/topic/157973-dealing-with-times-and-dates/#findComment-833257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.