mario
mario

Reputation: 395

How to insert date ISO 8601 on table?

I want to put this format data on my table: 2018-12-04T13:05:00-00:00

This should be done with a query:

$uPqr = $conn->query("UPDATE table SET dateModified = "the date goes here" WHERE id = 25");

I don't want to write the date on the query, i want to know if there's a function like NOW() or time() that do it automatically.

Upvotes: 0

Views: 667

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1270181

If you want the current time -- on the server -- then just use now():

$uPqr = $conn->query("UPDATE table SET dateModified = now() WHERE id = 25");

Upvotes: 1

Related Questions