Curdate() showing one day old date
I am using select curdate() to get date on mysql.
For example :: my Desktop Date is 12-May-2011. and when I am using select curdate()开发者_运维问答 then it is showing 11-May-2011. Query should return 12-May-2011.
Why it is happening. Server is GMT+700 timezone.
Please help me in this.
Thanks Pradeep
Your server and your desktop can wildly disagree on the current date. There's no requirement that they're synchronised so telling us that your desktop date is May 12 is irrelevant.
Since the DBMS is running on the server, it's the server that dictates what the time is.
I suggest you look into that. Contact whoever is maintaining MySQL and the server OS settings and get them to fix it.
精彩评论