Skip to content
lsl.devlsl.devLSL Dev

llGetTimeOfDay

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

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 parcel-scoped day cycle settings).

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

From the Second Life Wiki

Community documentation adapted from LlGetTimeOfDay, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.