I have a date field and a time field for users to enter date and time, I then need to convert this to a time stamp. Here is my code
<input type='text' name='date' />
<input type='text' name='time' />
How can I put them both together and then generate a timestamp to place in database
any help appreciated thanks
Use the strtotime()
function:
$ts = strtotime($_POST['date'].' '.$_POST['time']);
try this...
$timestamp = strtotime('date');