priyadharshini Posted October 21, 2010 Share Posted October 21, 2010 Hi I just want current date and time. When i use the function date("Y-m-d g:i:s") locally i get it correctly but when used in online it was lagging a day. My server is GoDaddy. Please suggest me to get it correctly. Quote Link to comment https://forums.phpfreaks.com/topic/216449-current-date-and-time/ Share on other sites More sharing options...
phil88 Posted October 21, 2010 Share Posted October 21, 2010 This isn't really a regex problem. It sounds to me that the server is running in a different timezone to you or the server's time is just plain wrong. You can use date_default_timezone_set to set the timezone to whatever you want. As far as setting the server's clock, you'd have to get into contact with godaddy about that. Quote Link to comment https://forums.phpfreaks.com/topic/216449-current-date-and-time/#findComment-1125028 Share on other sites More sharing options...
priyadharshini Posted October 22, 2010 Author Share Posted October 22, 2010 Got the result by using date_default_timezone_set Thank u! Quote Link to comment https://forums.phpfreaks.com/topic/216449-current-date-and-time/#findComment-1125167 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.