// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Validate a calendar date // Not compiled or tested in-world // Setup: Edit DATE and touch as owner. // Stop / restore: Remove or disable; results are reported only to the owner. // Notes: Accepts years 1900-2099. Validates a date only; does not convert to Unix time or enforce whether the date is in the future. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. string DATE="2028-02-29"; integer digitsOK(string value) { integer i; if(value=="" || llStringLength(value)>6)return FALSE; for(i=0;i2099 || m<1 || m>12) { llOwnerSay("Year or month out of range."); return; } list lengths=[31,28,31,30,31,30,31,31,30,31,30,31]; integer limit=llList2Integer(lengths,m-1); if(m==2 && (y%400==0 || (y%4==0 && y%100!=0)))limit=29; if(d<1 || d>limit)llOwnerSay("Day does not exist in that month."); else llOwnerSay("Valid Gregorian date."); } changed(integer flags) { if(flags & CHANGED_OWNER)llResetScript(); } }