Mysql difference between CURDATE() and NOW()

Mysql CURDATE

CURDATE() returns only date portion of date in current timezone.

select CURDATE();

Outcome

2015-12-02

Mysql NOW

NOW() returns full time in current timezone.

select NOW();

Outcome

2015-12-02 04:59:34

Mysql CURDATE and NOW in GMT timezone

SELECT convert_tz(CURDATE(), @@session.time_zone,'+00:00');
SELECT convert_tz(NOW(), @@session.time_zone,'+00:00');
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments