llGetTimeOfDay

From Second Life Wiki
(Redirected from LSL llGetTimeOfDay)
Jump to navigation Jump to search

Summary

Function: float llGetTimeOfDay( );
0.0 Forced Delay
10.0 Energy

Returns a float that is the time in seconds with sub-second precision since Second Life midnight (per the parcel-scoped day cycle settings).

By default (without custom environment settings), Second Life day cycles are 4 hours long, but can be configured to anywhere between 4 and 168 hours long.

Examples

default
{
    touch_start(integer total_number)
    {
        float tod = llGetTimeOfDay( );
        llOwnerSay("Time since midnight on current parcel:");
        integer hours = ((integer)tod / 3600) ;
        integer minutes = ((integer)tod / 60) - (hours * 60);
        llOwnerSay((string) tod + " seconds which is "+(string) hours+"h "+(string) minutes+"m"); 
    }
}

See Also

Functions

•  llGetSunDirection
•  llGetRegionTimeOfDay

Deep Notes

Signature

function float llGetTimeOfDay();