trecool999 Posted February 13, 2007 Share Posted February 13, 2007 How? I can only find date() which returns the server time and gmdate() which just doesn't help... I need it Day, Month, Year. Thanks to anyone that helps . Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/ Share on other sites More sharing options...
steviez Posted February 13, 2007 Share Posted February 13, 2007 Go here : http://uk2.php.net/time It helped me when i was stuck Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184030 Share on other sites More sharing options...
trecool999 Posted February 13, 2007 Author Share Posted February 13, 2007 Nope . It still comes up with the server date. Also, I need the time as well pls. Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184039 Share on other sites More sharing options...
steviez Posted February 13, 2007 Share Posted February 13, 2007 I used this: $date = date('F j, Y, g:i a'); Although im not sure if my servers are in the UK Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184044 Share on other sites More sharing options...
trecool999 Posted February 13, 2007 Author Share Posted February 13, 2007 February 14, 2007, 2:32 am Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184046 Share on other sites More sharing options...
steviez Posted February 13, 2007 Share Posted February 13, 2007 I take it its still not working Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184049 Share on other sites More sharing options...
fert Posted February 13, 2007 Share Posted February 13, 2007 if you want the time of the client you need to use javascript Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184052 Share on other sites More sharing options...
trecool999 Posted February 13, 2007 Author Share Posted February 13, 2007 But I need to insert it into a text file... . Here: $OpenLog = fopen("Log.log", 'a') or die("Error writing to log: Failed to track/write IP!"); fwrite($OpenLog, "User: " . $_SERVER['REMOTE_ADDR'] . " File: '" . $_FILES["file"]["name"] . "' Action taken: Upload Time: " . date('l dS \of F Y h:i:s A') . " "); But whenever I check the log, it tells me the server date and not the one I need to read . Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184057 Share on other sites More sharing options...
trecool999 Posted February 14, 2007 Author Share Posted February 14, 2007 if you want the time of the client you need to use javascript No, I just need it GMT time, but all the scripts I find don't work. Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184125 Share on other sites More sharing options...
hitman6003 Posted February 14, 2007 Share Posted February 14, 2007 have you used the gmmktime and gmdate functions? http://www.php.net/gmmktime http://www.php.net/gmdate Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184139 Share on other sites More sharing options...
trecool999 Posted February 14, 2007 Author Share Posted February 14, 2007 Thanks but no thanks, I found myself a script ! $timezone=-3; $time=time(); $gmttime= gmdate("M d Y H:i:s", $time); $convertedtime=date("M d Y H:i:s",strtotime("$timezone hours",strtotime($gmttime))); echo "$convertedtime <br> "; Quote Link to comment https://forums.phpfreaks.com/topic/38385-solved-setting-time-and-date-in-gmt/#findComment-184140 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.