Difference between revisions of "Stamp2WeekdayStr"
Jump to navigation
Jump to search
Void Singer (talk | contribs) m (moved from user page) |
Void Singer (talk | contribs) m (added byte costs) |
||
Line 11: | Line 11: | ||
'''Code:''' | '''Code:''' | ||
* LSO: | * LSO: 237 bytes | ||
* MONO: | * MONO: 1024 bytes | ||
<!-- Please replace with similarly licensed code only --> | <!-- Please replace with similarly licensed code only --> | ||
<lsl>string uStamp2WeekdayStr( integer vIntYear, integer vIntMonth, integer vIntDay ){ | <lsl>string uStamp2WeekdayStr( integer vIntYear, integer vIntMonth, integer vIntDay ){ |
Revision as of 16:21, 12 October 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials | User-Defined Functions | Void's User Page |
User-Defined Function: string uStamp2WeekdayStr( integer vIntYear, integer vIntMonth, integer vIntDay );
Returns a string that is the day of the week for the given date.
- vIntYear: source year
- vIntMonth: source month
- vIntDay: source day
Code:
- LSO: 237 bytes
- MONO: 1024 bytes
<lsl>string uStamp2WeekdayStr( integer vIntYear, integer vIntMonth, integer vIntDay ){ return llList2String ( ["Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"],
(vIntYear + (vIntYear >> 2) - ((vIntMonth < 3) & !(vIntYear & 3)) + vIntDay + (integer)llGetSubString( "_033614625035", vIntMonth, vIntMonth )) % 7 );
} /*//-- Anti-License Text --//*/ /*// Contributed Freely to the Public Domain without limitation. //*/ /*// 2009 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/
/*//-- --//*/</lsl>Caveats
- Accurate from 1901 to 2099