Don't click here unless you want to be banned.

LSL Wiki : llGetWallclock

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
float llGetWallclock()

Gets the time in seconds since midnight in the simulator server's time zone. The local time zone is either PST or PDT, depending upon the time of the year, as California observes Daylight Saving Time. The time that it returns is the same as the in-SL clock. llGetWallclock tracks that change and returns Pacific time in either PST or PDT, whichever is appropriate.

To get the current time in GMT, use llGetGMTclock.

How to convert this into hours, minutes and seconds:
integer    t;

integer    hours;
integer    minutes;
integer    seconds;

t = (integer)llGetWallclock(); // seconds since midnight

// one hour has 3600 seconds
hours = t / 3600; // get hours (integer division chops off the decimals)

// the modulo operator % gets the remainder of a divison
// in this case, the remaining seconds after removing the full hours
minutes = (t % 3600) / 60; // divide by 60 because we want minutes, chops off decimals again

seconds = t % 60; // get the seconds that didn't fit into full minutes

Compare with llGetTimeOfDay, llGetTime and llGetGMTclock.

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Simulator | Time
There is no comment on this page. [Display comments/form]