I am using the CURRENT_TIMESTAMP for inserting records in database and I want to save the time in users timezone?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several basic approaches:
Using only local time is an approach taken by devices which are not intended to inter-operate with other devices: simple programmable thermostats, wall clocks, and MSDOS.
At the other extreme is highly interactive systems, such as Unix and Linux, WANs, Wikipedia, blogs, etc., etc. This is the vast majority of distributed applications; they overwhelmingly use a standard timezone, usually UTC (note that GMT is no longer widely used). Users are usually tasked with converting between the standard timezone and what they find useful.
Another approach is to store the time with a standard timezone, but allow the user to customize the timezone for automatic translation. This approach is taken by all modern operating systems and some online applications, like airline reservation systems, etc.
To do that, every query which accessed a date or time would have to also retrieve the user’s configured timezone and apply it.