Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

time of SL...

GaL Soyer
Registered User
Join date: 24 Feb 2006
Posts: 47
04-13-2007 03:40
hello :)

assume that -
A=llGetWallclock();

A can hold the value of 86400 (number of seconds in the end of the day) or it torn to 0 after 86399?

thanks!
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-13-2007 04:34
Wouldnt the easiest way to find out to be to try it out?

CODE


ShowTime()
{
integer t = (integer)llGetWallclock(); // seconds since midnight
string timestr = "Time is " + (string)t + "\n";

integer hours = t / 3600;
t -= (hours * 3600);

integer minutes = (t / 60);
integer seconds = t % 60;

if(hours < 10)timestr += "0";
timestr += (string)hours+":";
if(minutes< 10)timestr += "0";
timestr += (string)minutes+":";
if(seconds< 10)timestr += "0";
timestr += (string)seconds;

llSetText(timestr);
}

default
{
state_entry() { ShowTime(); }

touch_start(integer num) { ShowTime(); }
}


Logically 0 seconds past midnight is 0 and 1 second before midnight (23:59:59) will be 86399