Jump to content

Dealing with times and dates


tibberous

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.