how to adjust clock at lavair sc
Started on the old forum in November 2010 · view the original in the archive · old links redirect here
You can use function to make your own time function
function your_time(){
$to_adjust = (3 * 60 * 60); // $to_adjust = (HOURs * MINs * SECs);
$your_time = time() + $to_adjust;
return $your_time;
}
OR
Change the default of your timezone
date_default_timezone_set(Asia/Hong_Kong);
For timezone list, go here PHP: List of Supported Timezones - Manual
ok, well you could go about this differently too...
if you add a field in the users table for timezone, then you can use the date_default_timezone_set(Asia/Hong_Kong); command to change time to users timezone so that it shows their time...
you would need to add a timezone list to the register form so they can select the closest timezone to their own...
something similar to this function, just link it to the database...
so code is: ///////////////////////////////////////////////////// /////////////function////////////////////////////// function clockbar($timezone) { date_default_timezone_set("$timezone"); $timenow = time(); $newdate = date('D jS M y',$timenow); $timenow = date("h:i:s A", $timenow); echo ""; echo "Time In: $timezone: "; echo ""; echo "Time: $timenow Date:$newdate"; echo ""; echo ""; } //////////////////////////////////////////////////////////////////// $timezone = mysql_fetch_array(mysql_query("SELECTtimezone FROM ibwf_users WHERE id='".$uid."'"));
echo "".clockbar($timezone[0]).""; ////////////////////////////////////////////////////////////////////
C3 Themes: http://c3themes.wen.ru/index.html Find Files: http://mystarter.tk/?goto=X-search
ok dude, read this: date manual that should help you out...
and generally if you use the date set timezone command you put that in config.php so that the timezone is set all the time...
date_default_timezone_set manual
that will give you more than i know about the command, lol... where you think i learned what i know? gooogle man...
C3 Themes: http://c3themes.wen.ru/index.html Find Files: http://mystarter.tk/?goto=X-search
