Difference between revisions of "Unix2WeekdayStr"

From Second Life Wiki
Jump to navigation Jump to search
m (typos + byte cost)
m
Line 22: Line 22:
/*//--                                                                --//*/</lsl>
/*//--                                                                --//*/</lsl>
}}
}}
=== Caveat ===
Important Note: This Function uses GMT Time as it stands...If you want it in SLT  - offset vIntDate by -8 hours (-28800 seconds) or (vIntDate-28800)


{{void-box
{{void-box

Revision as of 18:50, 12 August 2013

Summary

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>

Caveat

Important Note: This Function uses GMT Time as it stands...If you want it in SLT - offset vIntDate by -8 hours (-28800 seconds) or (vIntDate-28800)