Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

EbrahemSamer's avatar

How to get the current datetime MYSQL - PHP ?

I am trying to select now() from mysql and it gets time after 3 hours from now how to get the exact time .

I am working on server online

0 likes
3 replies
siangboon's avatar

it may be the timezone different... try check the timezone

SELECT @@global.time_zone, @@session.time_zone;

Please or to participate in this conversation.