Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to I detect the month of the year only?

Dumisani Ah
Pass me the hammer
Join date: 2 Dec 2006
Posts: 95
06-30-2008 12:36
Is there a way to capture only the month of the RL year in lsl? I've played with llGetTimestamp, but it seems a rather roundabout way to get just one thing like the month?
_____________________
Screwdrivers are so 90's...
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-30-2008 12:53
See http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetDate
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
06-30-2008 13:00
Do you need the month as a number, or as a word?
_____________________
Thread attempting to compile a list of which animations are freebies, and which are not:

http://forums.secondlife.com/showthread.php?t=265609
Dumisani Ah
Pass me the hammer
Join date: 2 Dec 2006
Posts: 95
06-30-2008 13:02
From: Chaz Longstaff
Do you need the month as a number, or as a word?


Hi Chaz, just a number. I want to use it as triggers for a set of scrip states ;)
_____________________
Screwdrivers are so 90's...
Chaz Longstaff
Registered User
Join date: 11 Oct 2006
Posts: 685
06-30-2008 13:14
sorry, I should have also asked *which* month. GMT, or SL month? (at the end of each month, GMT month changes a few hours before SL month does -- I forgot to take that into account in my early days.) For instance, tomorrow is July, but calendar pages will flip to July later in SL time than they will in GMT.

If SL time, the script on the page that Hewee provided the link for can easily be moded to return just the month.
_____________________
Thread attempting to compile a list of which animations are freebies, and which are not:

http://forums.secondlife.com/showthread.php?t=265609
Dumisani Ah
Pass me the hammer
Join date: 2 Dec 2006
Posts: 95
06-30-2008 13:22
From: Chaz Longstaff
sorry, I should have also asked *which* month. GMT, or SL month? (at the end of each month, GMT month changes a few hours before SL month does -- I forgot to take that into account in my early days.) For instance, tomorrow is July, but calendar pages will flip to July later in SL time than they will in GMT.

If SL time, the script on the page that Hewee provided the link for can easily be moded to return just the month.


Chaz, it actually can be either. I'm using it to create seasons for an idea or two ;) Let me have a crack at Hewee's suggestion as it is one that I missed in my previous search of the wiki :( Thanks Hewee!
_____________________
Screwdrivers are so 90's...
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
07-01-2008 00:45
CODE

default
{
touch_start(integer total_number)
{
llSay(0,"Month is " + llGetSubString(llGetDate(),5,6));
}
}


if you need it as an integer

integer Month = (integer)llGetSubString(llGetDate(),5,6);
Dumisani Ah
Pass me the hammer
Join date: 2 Dec 2006
Posts: 95
07-01-2008 01:02
From: Very Keynes
CODE

default
{
touch_start(integer total_number)
{
llSay(0,"Month is " + llGetSubString(llGetDate(),5,6));
}
}


if you need it as an integer

integer Month = (integer)llGetSubString(llGetDate(),5,6);


Hi Very, this will be a much better version for me to try. Its less cumbersome WOOOTTTTT. Thank you very much.
_____________________
Screwdrivers are so 90's...