# llGetDayOffset

*LSL function*

```lsl
integer integer llGetDayOffset();
```

- Returns: `integer`
- Energy: 10

Return the number of seconds added to the current time before calculating the current environmental time for the parcel. [llGetDayOffset](/functions/llGetDayOffset/) returns the value for the current parcel, [llGetRegionDayOffset](/functions/llGetRegionDayOffset/) produces the same value for the entire region.

```lsl title="How to use" frame="terminal"
integer result = llGetDayOffset();
```

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-13}
// print the apparent time of day as HH:MM (%), just like the environment window in the viewer.
// Time of day is a fraction between 0 and 1, 0 is midnight, 0.5 is noon
string printTimeOfDay(float dayFraction) {
    integer hours = (integer)(dayFraction * 24);
    integer minutes = (integer)(dayFraction * 24 * 60) % 60;
    integer percent = (integer)(dayFraction * 100);
    return (string)hours + ":" + llGetSubString((string)(100+minutes), 1, 2) + " (" + (string)percent + "%)";
}

default {
    state_entry() {
        llSetTimerEvent(5);
    }

    timer() {
        float timeOfDay = (llGetUnixTime() + llGetDayOffset()) % llGetDayLength() * 1.0 / llGetDayLength();
        llSetText(printTimeOfDay(timeOfDay), <1,1,0>, 1);
    }
}
```

</details>

## See also

### Functions

- [llGetEnvironment](/functions/llGetEnvironment/)

Newer function that consolidates many environment-based settings.

- [llGetDayLength](/functions/llGetDayLength/)
- [llGetDayOffset](/functions/llGetDayOffset/)
- [llGetMoonDirection](/functions/llGetMoonDirection/)
- [llGetMoonRotation](/functions/llGetMoonRotation/)
- [llGetSunDirection](/functions/llGetSunDirection/)
- [llGetSunRotation](/functions/llGetSunRotation/)
- [llGetRegionDayLength](/functions/llGetRegionDayLength/)
- [llGetRegionDayOffset](/functions/llGetRegionDayOffset/)
- [llGetRegionMoonDirection](/functions/llGetRegionMoonDirection/)
- [llGetRegionMoonRotation](/functions/llGetRegionMoonRotation/)
- [llGetRegionSunDirection](/functions/llGetRegionSunDirection/)
- [llGetRegionSunRotation](/functions/llGetRegionSunRotation/)

---

*Source: [LlGetDayOffset](https://wiki.secondlife.com/wiki/LlGetDayOffset) on the Second Life Wiki. Content from the Second Life Wiki article LlGetDayOffset (revision 1211036, 2022-08-23), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetDayOffset/
