Hey, I have a Joomla project I'm working on and call the function "date" to get the current hour and minute. BUT, when I call the same function in the main directory of the project, the date is 8 hours off. Same function. Same call. Whats happening? I was thinking one may be the Joomla date, the other the server date but thats not it. Any ideas? Thanks,
Is the server placed in another country? If not, you can try to use echo date_format($date, 'H:i:s'); Code (markup):
you might have to get the country and add or subtract the hours in the date code ..after you out out the hours, minutes seconds. break each down into $hour $minute etc ad do a standard +/- math on it to update it to your timestamp/date probablyhave to use an if or else statement to get the country and time and conversion exampl: if($position = "California" { $time_update = $time_hour - 3; } elseif($position = "Iraq" { $time_update = $time_hour + 8; etc Somebody has probably written a code for this by now as this would be a common problem encountered by International sites
It sounds like either a php.ini / environment override exists in one place and not in another -or- Joomla has date_default_timezone_set() set. -Bing