I am working on a time sheet program. The user selects the date, hour, and minute they started and stopped working. I am trying to convert and store the times as seconds since epoch.
I can convert the date selected with no problems. What I am having trouble with is taking the hours amd minutes selected from the drop-down and converting them into seconds to add the date which has already been converted.
Here is a sample from the form:
<select name="start_hour">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<select name="start_minutes">
<option value="00">00</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
</select>
<select name="start_ampm">
<option value="AM">AM</option>
<option value="PM">PM</option>
</select>
<!-- date selected -->
<input type="hidden" name="lt_day" value="2005-11-03">
And here is part of the PHP
$starttime = strtotime($lt_day); //equals 1130994000
I have been reading the date and time functions but keep getting confused. How can I take the time selected in the form and add it to $starttime?