zeusthegreat Posted April 26, 2013 Report Share Posted April 26, 2013 (edited) time.php <?php include("conf.php"); function getlang($language, $charset) { global $lang; global $diff; global $char; if (!isset($lang) || empty($lang) || $lang == "false") { $found_lang[0] = strtolower(substr($language,0,3)) . '_' . strtoupper(substr($language,0,3)); $found_lang[1] = strtolower(substr($language,0,3)) . '-' . strtoupper(substr($language,0,3)); $found_lang[2] = strtolower(substr($language,0,2)) . '_' . strtoupper(substr($language,0,2)); $found_lang[3] = strtolower(substr($language,0,2)) . '-' . strtoupper(substr($language,0,2)); } else { $found_lang[0] = strtolower(substr($lang,0,3)) . '_' . strtoupper(substr($lang,0,3)); $found_lang[1] = strtolower(substr($lang,0,3)) . '-' . strtoupper(substr($lang,0,3)); $found_lang[2] = strtolower(substr($lang,0,2)) . '_' . strtoupper(substr($lang,0,2)); $found_lang[3] = strtolower(substr($lang,0,2)) . '-' . strtoupper(substr($lang,0,2)); } if (!isset($char) || empty($char) || $char == "false") { $char = $charset; } $lang = array($found_lang[0],$found_lang[1],$found_lang[2],$found_lang[3]); if (function_exists('mb_convert_encoding')) { setlocale(LC_ALL, $lang); $date = ucwords(strftime("%A, %d %B %Y")) . " " . gmdate("H:i:s", time() + $diff); $time = mb_convert_encoding($date, "$char"); } else { setlocale(LC_ALL, $lang); $time = ucwords(strftime("%A, %d %B %Y")) . " " . gmdate("H:i:s", time() + $diff); } echo $time; } ?> conf.php <?php $lang = "eng"; // Put your language or put false // For example: "eng" or "ita" or "deu" or "fra"... or "false" $char = "ISO-8859-1"; // Put your charset or put false // For example: "UTF-8" or "ISO-8859-1"... or "false" $diff = "0"; // Change this with your different GMT time ?> It is an hour out I thought I had set it to GMT I am in the uk by the way! but it is 1 hour behind pls help anyone thanks Edited April 26, 2013 by talos Quote Link to comment Share on other sites More sharing options...
grabenair Posted April 26, 2013 Report Share Posted April 26, 2013 Here this will explain it better then I can. http://php.net/manual/en/function.date-default-timezone-set.php Quote Link to comment Share on other sites More sharing options...
zeusthegreat Posted April 26, 2013 Author Report Share Posted April 26, 2013 I have done some checking and London is GMT +1 I thought it was 0 getlang "eng" ,"ISO-8859-1" , "+1" still cannot get it to work though weird I have done this before with no probs any detailed accounts please Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.