开发者

Curdate() showing one day old date

开发者 https://www.devze.com 2023-03-05 20:40 出处:网络
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 retur

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消