html中的时间戳

时间:2016-05-25 04:40:28

标签: php html mysql

我正在尝试在我的数据库中存储时间戳。 HTML代码:

<form action="insert.php" method="POST"/>

<style>
p{
    float:center;
}
</style>


<Font color=red > <center>Support or Analysis Tracker (SoAT) </center></Font>
</br>
</br>

<p align="left">
<label for="PROCESS"><FONT color=default>Analysis/Support</label> &nbsp</t>
 <select id="PROCESS" name="PROCESS">
<option value="Analysis">Analysis</option>
<option value="Support">Support</option>
</select> 
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<label for="SO_NUMBER"><FONT color=default>SO_Number</label>
    <input type="text" id="SO_NUMBER" name="SO_NUMBER"  value ="SO_" required/>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  <label for="PERSON_INCHARGE"><FONT color=default>Person_Incharge</label>
  <input type="text" id="PERSON_INCHARGE" name="PERSON_INCHARGE" required/></br>
</br></br>
</br>
</p>
<p align="left">
    <label for="DESCRIPTION"><FONT color=default>Description</label>
    <input type="text" id="DESCRIPTION" name="DESCRIPTION" />

</p>

</br>
    </br>
<div style="text-align:center"> 
<button>

   <img alt="ok" src=
   "http://www.blueprintcss.org/blueprint/plugins/buttons/icons/tick.png" /> 

INSERT
  </button>
</fieldset>
</form>

点击插入按钮后,我需要将当前时间和日期存储在数据库中。后端数据库结构如下:

Database structure

1 个答案:

答案 0 :(得分:0)

在这些情况下,您可以使用mysql的now()函数。

Insert INTO tablename(RECEIVED) VALUES(now())

使用这种结构,它使用mysql服务器的日期和时间