c_shelswell Posted November 20, 2006 Share Posted November 20, 2006 Hi is there anyway using php to get the actual date from a trusted source rather than it taking the date from a users computer clock?Can it be grabbed off the internet in anyway?Many thanks Link to comment https://forums.phpfreaks.com/topic/27899-getting-correct-date/ Share on other sites More sharing options...
kenrbnsn Posted November 20, 2006 Share Posted November 20, 2006 PHP takes the date/time from the server where it runs, not the local PC.Ken Link to comment https://forums.phpfreaks.com/topic/27899-getting-correct-date/#findComment-127564 Share on other sites More sharing options...
The Little Guy Posted November 20, 2006 Share Posted November 20, 2006 If you would like to change the date of the server do this:[code]<?php$day = date("j") + 2; // day 1 - 31 and add 2$month = date("n") + 5; // month 1 through 12 and add 5$year = date("Y") - 3; // year yyyy and subtract 3echo $month.'/'.$day.'/'.$year;?>[/code] Link to comment https://forums.phpfreaks.com/topic/27899-getting-correct-date/#findComment-127568 Share on other sites More sharing options...
c_shelswell Posted November 21, 2006 Author Share Posted November 21, 2006 excellent thanks - that'll be why it was changing the time when i changed my pc's clock - silly me ;) Link to comment https://forums.phpfreaks.com/topic/27899-getting-correct-date/#findComment-127856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.