Skip to content
lsl.devlsl.devLSL Dev

llGetRegionTimeOfDay

function
Function syntax
float llGetRegionTimeOfDay();
Returns
float
Energy
10

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.

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

How to use
float result = llGetRegionTimeOfDay();
Example 1
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");
}
}
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.