iremce
iremce

Reputation: 620

Php date function does not work

I am using php date function to get date and time. But time information that I got is incorrect. What can I do for this problem solution? Thanks..

php code :

$d = date('Y-m-d h:i:s');

Upvotes: 1

Views: 4433

Answers (2)

C0D3
C0D3

Reputation: 6559

Try using the examples shown here: http://php.net/manual/en/function.date.php Careful that 'h' should be capital.

This should fix it but if still doesn't work, is your computers time correct?

Upvotes: 2

Nicola Cossu
Nicola Cossu

Reputation: 56397

Have you tried this?

$d = date('Y-m-d H:i:s');

Upvotes: 4

Related Questions