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. 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. 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! Link to comment https://forums.phpfreaks.com/topic/216449-current-date-and-time/#findComment-1125167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.