CincinnatiBearcats Posted July 11, 2012 Share Posted July 11, 2012 Hi,Is there a way to get the Eastern Standard Time? The closest thing I see is llGetTimestamp.Thanks. Link to comment Share on other sites More sharing options...
Dora Gustafson Posted July 11, 2012 Share Posted July 11, 2012 Use llGetWallClock and add what hours you are ahead of SL time Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 11, 2012 Share Posted July 11, 2012 Here's Void's version, posted in the LSL wiki at http://wiki.secondlife.com/wiki/LlGetGMTclock //--// GMT function with local offsets in 12hr format //--// integer gIntMinute = 60; //-- 1 minute in secondsinteger gIntHour = 3600; //-- 1 hour in secondsinteger gInt12Hr = 43200; //-- 12hrs in secondsinteger gIntDay = 86400; //-- 1 day in seconds string fStrGMTwOffset( integer vIntLocalOffset ){ //-- get the correct time in seconds for the given offset integer vIntBaseTime = ((integer)llGetGMTclock() + gIntDay + vIntLocalOffset * gIntHour) % gIntDay; string vStrReturn; //-- store morning or night and reduce to 12hour format if needed if (vIntBaseTime < gInt12Hr){ vStrReturn = " AM"; }else{ vStrReturn = " PM"; vIntBaseTime = vIntBaseTime % gInt12Hr; } //-- get and format minutes integer vIntMinutes = (vIntBaseTime % gIntHour) / gIntMinute; vStrReturn = (string)vIntMinutes + vStrReturn; if (10 > vIntMinutes){ vStrReturn = "0" + vStrReturn; } //-- add in the correct hour, force 0 to 12 if (vIntBaseTime < gIntHour){ vStrReturn = "12:" + vStrReturn; }else{ vStrReturn = (string)(vIntBaseTime / gIntHour) + ":" + vStrReturn; } return vStrReturn;} default{ touch_start( integer vIntTouched ){ //-- '-5' is EST, no adjustment for DST llSay( 0, "The time is now " + fStrGMTwOffset( -5 ) ); }} All I did was put in the GMT -5 offset for EST. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now