# How can you auto generate the time on Date time data type?

**URL:** <https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390>\
**Category:** MySQL database\
**Created:** [April 21, 2021, 5:25pm UTC](https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390 "2021-04-21T17:25:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![idontknowphp](https://www.phphelp.com/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@idontknowphp](https://www.phphelp.com/u/idontknowphp)\
**Post date:** [April 21, 2021, 5:25pm UTC](https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390/1 "2021-04-21T17:25:41Z")

</div>

![image](https://www.phphelp.com/uploads/default/original/2X/d/de49ef588ba98e7eea9074c28585b6681d58605f.png)

---

<div class="post-metadata">

**Author:** ![ErnieAlex](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/bc8723/32.png) [@ErnieAlex](https://www.phphelp.com/u/ErnieAlex)\
**Post date:** [April 21, 2021, 9:12pm UTC](https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390/2 "2021-04-21T21:12:28Z")

</div>

In PHP or SQL? now() is one of those funcitons… Ask your question, please do not post a picture. I see no question in your image!

---

<div class="post-metadata">

**Author:** ![idontknowphp](https://www.phphelp.com/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@idontknowphp](https://www.phphelp.com/u/idontknowphp)\
**Post date:** [April 21, 2021, 11:15pm UTC](https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390/3 "2021-04-21T23:15:45Z")

</div>

I solved it… I just don’t know how to delete this question.

---

<div class="post-metadata">

**Author:** ![ErnieAlex](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/bc8723/32.png) [@ErnieAlex](https://www.phphelp.com/u/ErnieAlex)\
**Post date:** [April 22, 2021, 3:46pm UTC](https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390/4 "2021-04-22T15:46:06Z")

</div>

Normally, in a forum, once you solve a solution to problem, you just post the new fixed version. This allows others who come along later, in a month, year, whatever, who have the same problem, they can see how you solved it and that solution will help them, too. Pay-forward as they say. so, do not delete this, just post your solution. Or at least the important parts. Or, even just text explaining how you solved it.

---

<div class="post-metadata">

**Author:** ![idontknowphp](https://www.phphelp.com/letter_avatar_proxy/v4/letter/i/c68b51/32.png) [@idontknowphp](https://www.phphelp.com/u/idontknowphp)\
**Post date:** [April 23, 2021, 3:52am UTC](https://www.phphelp.com/t/how-can-you-auto-generate-the-time-on-date-time-data-type/33390/5 "2021-04-23T03:52:59Z")

</div>

I think this was what I did:  
I created a table and then created a field and on the data type, I chose DATETIME and then right clicked on it and chose CURRENT\_TIMESTAMP

 ![image](https://www.phphelp.com/uploads/default/original/2X/f/f8d948c09ff46b5e531744d20568a1559ff351b7.png)

 ![image](https://www.phphelp.com/uploads/default/original/2X/2/2bc7996743534e9ec3218a029c515963aee29e39.png)
