How to get current date, and put in an insert? [duplicate]

2

How can I get the current date of the server and put it in my query to send to the bank? I do not have the slightest idea how I can get the current time and put in a variable to send to the bank, thank you.

    
asked by anonymous 17.06.2017 / 21:02

1 answer

3

You can do this in bank language. If it is MySQL you can use NOW() which gives YYYY-MM-DD HH:MM:DD ie date and time.

In PHP there are several ways, one of them date("Y-m-d H:i:s") , another is

$now = new DateTime();
$datetime = $now->format('Y-m-d H:i:s'); 
    
17.06.2017 / 21:18