I have created a planner using php and jquery on my application. I have a section, where the user inputs start date and start time, and another where they input the end date and end time. The fields are all seperate, like so:
<input type="text" name="dateFrom" id="dateFrom"> <!-- datepicker plugin -->
<input type="text" name="time_from" id="timeFrom"> <!-- timepicker plugin -->
<input type="text" name="dateTo" id="dateTo"> <!-- datepicker plugin -->
<input type="text" name="time_to" id="timeTo"> <!-- timepicker plugin -->
What I want to know is once the user has inputted the above information, and submits the data to the database, instead of creating seperate columns in the table, is there anyway of inserting the dateFrom
and timeFrom
fields into one database column named start_time
as a UNIX timestamp, and also the same for the dateTo
& timeTo
fields.
Can anyone give me any ideas on how I would do this?