Jump to content

timezone alter time


everlifefree

Recommended Posts

I was wondering if you could help me make it so that my users last login and online since will so the proper time relating to there timezone instead of just the time on the server. When my user sign up the enter a variable into the database of like "US mountain time would be -7" and the variable "-7" in stored in the database table users under the timezone section thing... Please help!

 

heres the current php used:

 

/* Figure out if the user is online or not */

if (_fnc("user", $_GET["id"], "last_load") > (date("U") - 180)) {

$tpl -> Zone("onlinecheck", "online");

$tpl -> AssignArray(array(

"onlinesince" => date($CONF["LOCALE_SHORT_TIME"], _fnc("user", $_GET["id"], "last_login")),

"online.object" => $GLOBALS["OBJ"]["online"]

));

 

} elseif (_fnc("user", $_GET["id"], "last_login") != 0) {

$tpl -> Zone("onlinecheck", "offline");

$tpl -> AssignArray(array(

"lastlogin" => date($CONF["LOCALE_SHORT_DATE_TIME"], _fnc("user", $_GET["id"], "last_login")),

"online.object" => NULL

));

 

} else {

$tpl -> Zone("onlinecheck", "nologin");

$tpl -> AssignArray(array(

"lastlogin" => NULL,

"online.object" => NULL

));

}

 

 

Link to comment
https://forums.phpfreaks.com/topic/84587-timezone-alter-time/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.