// SPDX-License-Identifier: MIT
// Copyright (c) 2026 Incoprea
// Current UTC weekday
// Not compiled or tested in-world
// Setup: Touch as owner. No timezone configuration is needed because the report uses UTC.
// Stop / restore: Remove or disable the script. It does not change the build.
// Notes: Unix day zero was a Thursday. This calculation is for nonnegative Unix timestamps; it is not a historical calendar or local-time converter.
// License: see LICENSE in this distribution.
// Original Incoprea example. MIT.
default
{
    touch_start(integer count)
    {
        if (llDetectedKey(0) != llGetOwner()) return;
        list days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
        integer dayNumber = llGetUnixTime() / 86400;
        integer weekday = (dayNumber + 4) % 7;
        llOwnerSay("UTC " + llGetDate() + ": " + llList2String(days, weekday));
    }
    changed(integer flags)
    {
        if (flags & CHANGED_OWNER) llResetScript();
    }
}
