Difference between revisions of "Unix2WeekdayStr"
Jump to navigation
Jump to search
Void Singer (talk | contribs) m (moved from user page) |
Void Singer (talk | contribs) m (typos + byte cost) |
||
Line 2: | Line 2: | ||
<div style="float:right;">__TOC__</div> | <div style="float:right;">__TOC__</div> | ||
{{void-box | {{void-box | ||
|title=<div style="display:none"><h2>Summary</h2></div>[[:Category:LSL_User-Defined_Functions|User-Defined Function]]: [[string]] uUnix2WeekdayStr( [[integer]] '' | |title=<div style="display:none"><h2>Summary</h2></div>[[:Category:LSL_User-Defined_Functions|User-Defined Function]]: [[string]] uUnix2WeekdayStr( [[integer]] ''vIntDate'' ); | ||
|content= | |content= | ||
Returns a string that is the day of the week for the given date. | Returns a string that is the day of the week for the given date. | ||
* '' | * ''vIntDate'': source Unix time stamp | ||
'''Code:''' | '''Code:''' | ||
* LSO: | * LSO: 155 bytes | ||
* MONO: | * MONO: 512 bytes | ||
<!-- Please replace with similarly licensed code only --> | <!-- Please replace with similarly licensed code only --> | ||
<lsl>string uUnix2WeekdayStr( integer | <lsl>string uUnix2WeekdayStr( integer vIntDate ){ | ||
return llList2String( ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"], | return llList2String( ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"], | ||
vIntDate % 604800 / 86400 + (vIntDate >> 31) ); | vIntDate % 604800 / 86400 + (vIntDate >> 31) ); |
Revision as of 15:54, 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 uUnix2WeekdayStr( integer vIntDate );
Returns a string that is the day of the week for the given date.
- vIntDate: source Unix time stamp
Code:
- LSO: 155 bytes
- MONO: 512 bytes
<lsl>string uUnix2WeekdayStr( integer vIntDate ){
return llList2String( ["Thursday", "Friday", "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday"], vIntDate % 604800 / 86400 + (vIntDate >> 31) );
} /*//-- 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>