-6

How do I create this using PHP, for the current timestamp, ready to insert into a mysql database timestamp field:

2015-06-27 12:58:10

I want to insert a created_timestamp field basically...

I don't want to use the database's "on update current timestamp" feature because I want this to be a permanent fixed record.

4
  • 2
    Have you done any research or put any effort into your question? Commented Jun 27, 2015 at 13:04
  • @Rizier123 yes but I'm terrible with timestamps and such functions. Commented Jun 27, 2015 at 13:07
  • @AmyNeville But I think you know how to use google. So: PHP date <- That's it first php.net manual page and you got it all there. Commented Jun 27, 2015 at 13:10
  • @Rizier123 if I knew I was looking for the date function then yes... Commented Jun 27, 2015 at 13:22

1 Answer 1

3

Use PHP's date() function

date("Y-m-d H:i:s")
Sign up to request clarification or add additional context in comments.

1 Comment

Perfect thanks! I'll accept in 9mins

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.