So our server is located in Cali and we are 2 hours ahead so When I save my time to database it does it according to the local time.

I tried to figure out how to use GetDate() and GetUTCDate() but can not figure out how to use it.

How do I make it so when I log in here it saves as this local time and not the databases local time?

Any help would be appriciative


Recommended Answers

Those functions are not for MySQL, you have to use CONVERT_TZ():

You can also change the database time zone, for example:

SET GLOBAL time_zone = 'UTC';

Jump to Post

All 2 Replies

USE NOW() ..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.