How do add date and time stamp to an INSERT via PHP with mySQL?

前端 未结 4 1748
感动是毒
感动是毒 2021-01-24 18:38

I have an insert script with mySQL. I need to place the date and time when the record is created in the \'add_time\" column.

Can anyone show me how to modify my existin

4条回答
  •  暖寄归人
    2021-01-24 19:25

    I like Sam's answer, as it is best - as an alternative, however, you could use date("m/d/Y H:i A"); as per your requirements - ie. it will output MM/DD/YYYY HH:MM AM/PM. Though if you use Sam's method, it will require less code, but you'd need to convert it to get you desired format.

提交回复
热议问题