Jump to content

[SOLVED] adding date and time together


runnerjp

Recommended Posts

ok i have got my form to enter tiem and date of a race

<form name="f" method="POST">
  <table cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"><tr><td>
    <table cellpadding="4" cellspacing="1" border="0 "bgcolor="#FFFFFF">
      <tr><td colspan="2" bgcolor="#000000"><font size="+1" color="#FFFFFF"><b>Add New Event</b></font></td></tr>
      <tr><td><b>Event Start Date: </b></td><td><input type="text" name="eventdate" value="" size="12"> <font size="2">mm/dd/yyyy</font></td></tr>
          <tr><td><b>Event Start: </b></td><td><input name="start" size="6"/><font size="2">00:00</font></td></tr>
          <tr><td><b>Event finish Date: </b></td><td><input type="text" name="eventdate" value="" size="12"> <font size="2">mm/dd/yyyy</font></td></tr>
          <tr><td><b>Event Finish: </b></td><td><input name="finish" size="6" /><font size="2">00:00</font></td></tr>
          <tr><td><b>Event:</b></td><td><input type="text" name="event" size="35" maxlength="128"></td></tr>
      <tr><td colspan="2" align="center" bgcolor="#CCCCCC"><input type="button" name="Submit" value="OK" onClick="javascript: formget2(this.form, 'http://www.runningprofiles.com/members/calendar/addevent.php');"> </td></tr>
        </table></td></tr></table></form>

 

how can i add both the dates and time together using strtotime() ??

 

so then i can call from my db like this

 

$iso_8601_date_time_string = date('Y-m-d', strtotime("April 17, 2009"));

$sql = "SELECT e_id FROM events WHERE '$iso_8601_date_time_string' BETWEEN e_start AND e_end";

 

Link to comment
https://forums.phpfreaks.com/topic/154512-solved-adding-date-and-time-together/
Share on other sites

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.