These forums are CLOSED. Please visit the new forums HERE
Day of week from Date? |
|
Mike Zidane
Registered User
![]() Join date: 10 Apr 2004
Posts: 255
|
09-22-2004 10:57
Anyone know how to figure out the day of the week from the date? ie, if I use llgettimestamp to get the date... how do I know if today is wednesday?
|
Francis Chung
This sentence no verb.
![]() Join date: 22 Sep 2003
Posts: 918
|
09-22-2004 11:18
I figured this out once. I forget the exact algorithm, and I'm not in-world right now to go fetch it.
I sell some wrist-watches, the source code for which I've tagged GPL. Grab a landmark from my profile picks to find a copy ![]() _____________________
--
~If you lived here, you would be home by now~ |
Samhain Broom
Registered User
![]() Join date: 1 Aug 2004
Posts: 298
|
09-22-2004 11:27
why not use this:
string strDate = llGetDate(); see that here llGetDate That page also has a link to llGetTimeStamp() If you wanted to use the llGetTimeStamp() function, then use a string parsing command to get the first 10 characters from the string produced by the llGetTimeStamp(). string strDate = string result = llGetSubString(llGetTimeStamp(), 0, 9); (I think that should work)... only don't try that in the global definitions area, it might not work there. _____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
MSo Lambert
Registered User
Join date: 16 Aug 2004
Posts: 101
|
09-22-2004 11:57
Samhain, I believe Mike wants to know the day of the week (like today is wednesday), not the current date.
I couldn't find the Francis' GPLed code, but I've been using this function (algorithm based on Zeller's congruence): CODE
Example usage: CODE // Constants _____________________
MSo
|
Mike Zidane
Registered User
![]() Join date: 10 Apr 2004
Posts: 255
|
09-22-2004 12:41
Thankyasir, I do belive that'll do it
![]() |
Samhain Broom
Registered User
![]() Join date: 1 Aug 2004
Posts: 298
|
09-23-2004 11:27
Oops! I must have been sleepy reading that. Somehow I knew my answer was too easy! =)
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|