Skip to content
lsl.devlsl.devLSL Dev

LlGetRegionTimeOfDay

Looking for the current API? Open the llGetRegionTimeOfDay reference →

Function notes

Will return the same result as llGetTimeOfDay on parcels that use region environment 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.

Return value notes

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

Examples

default
{
    touch_start(integer total_number)
    {
        float tod = llGetRegionTimeOfDay( );
        llOwnerSay("Time since midnight on current region:");
        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

Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.