llGetTimeofDay script reports time as running 30 minutes fast on sitting on a scripted object
tracked
Emma Krokus
I have a gadget showing SL daytime and description of cycle within the day (morning, afternoon etc). Noticed that whilst I was sitting down (tried AVsitter and nPose scripted furniture), it suddenly ran 30 minutes fast at this location:
Second Life Release 7.1.12.13550888671 (64bit)
You are at 146.4, 145.0, 34.4 in Darkover located at simhost-090715bfd81f9bf4e.agni
(global coordinates 257,426.0, 230,289.0, 34.4)
Second Life Server 2025-03-14.13862207703
but not at this location:
Second Life Release 7.1.12.13550888671 (64bit)
Release Notes
You are at 107.9, 124.2, 1,001.0 in Moonbow located at simhost-0baa562fa277f8a2d.agni
(global coordinates 180,076.0, 287,356.0, 1,001.0)
Second Life Server 2025-03-14.13862207703
Release Notes
It reverts to the correct time on "unsitting". Same result with Genesis viewer (latest release version) AND the current SL viewer.
Log In
Maestro Linden
tracked
Maestro Linden
needs info
Hi Emma are you able to reproduce this? I visited your SLURL in Darkover, and rezzed 2 copies of your script in identical boxes. The time of day shown by the 2 scripts always matched, even when my avatar sat on one box and stood up.
It wouldn't matter for this bug, but the script makes some assumptions about the day length and day offset, which might cause it to show an incorrect time of day depending on the parcel EEP settings. You can query the ENVIRONMENT_DAYINFO parameter from https://wiki.secondlife.com/wiki/LlGetEnvironment to see what the actual day length and offset is based on region or parcel EEP settings.
Emma Krokus
Maestro Linden Hi:) I just tried it. The time on the box I sat on did NOT change BUT the time on the HUD with the same script in it did. It does seem to be triggered in the HUD by sitting down (EVEN WHEN the object you sit on is not scripted. I had previously assumed it was something to do with the animation engine - I had tried nPose and Avsitter scripted furniture)
Emma Krokus
It also does not happen when I just sit on the ground instead of the box.
Emma Krokus
Definitely just happens when I sit on an object.
Maestro Linden
Emma Krokus: Thanks for the clarification. Looking again, I do see that llGetTimeOfDay() in an avatar-attached script reports a different time when the avatar is seated. As you said, in the 'Darkover' region the difference is 30 minutes (1800 seconds)
Looking at the region settings, it's pretty clear that llGetTimeOfDay() is querying the time of day at the wrong position. Rather than looking at the seated avatar's position within the sim, it appears to be querying the environment data at a parcel near the origin - it's probably using the attachment's local offset (<0,0,0> in my case) as the position in the region to query.
llGetEnvironment() shows the 2 distinct day lengths and midnight-offsets for those 2 parcels:
[09:27] GetReplaceEnvironmentTest: llGetEnvironment() returned these values at position <0.00000, 0.00000, 0.00000>:
ENVIRONMENT_DAYINFO, 151200, 1800, 147455.500000
[09:27] GetReplaceEnvironmentTest: llGetEnvironment() returned these values at position <147.19770, 146.22970, 33.92554>:
ENVIRONMENT_DAYINFO, 14400, 57600, 1663.740479
As a near-term fix, you should be able to use the llGetEnvironment() ENVIRONMENT_DAYINFO results to get the correct 'time of day' for the attachment's position.
Emma Krokus
Maestro Linden Thanks for the helpful and interesting explanation!