llGetDate

From Second Life Wiki
Revision as of 06:39, 2 July 2008 by Nynthan Folsom (talk | contribs) (Revised the leap year calculation again!)
Jump to navigation Jump to search

Summary

Function: string llGetDate( );
0.0 Forced Delay
10.0 Energy

Returns a string that is the current date in the UTC time zone in the format "YYYY-MM-DD".

If you wish to know the time as well use: llGetTimestamp which uses the format "YYYY-MM-DDThh:mm:ss.ff..fZ"

Examples

<lsl> // Birthday surprise default {

   state_entry()
   {   
       llSetTimerEvent(0.1);
   }
   timer()
   {
       if(llGetDate() == "2009-02-15")
           llSetText("HAPPY BIRTHDAY!", <0,1,0>, 1.0);
       else
           llSetText("A surprise is coming...", <0,1,0>, 1.0);
        
       llSetTimerEvent(3600.0);  // check every hour. 
   }

} </lsl> <lsl> // Function to calculate the numeric day of year integer DayOfYear(integer year, integer month, integer day) {

   return
       day
       + (month - 1) * 30 - (1 + 
           ((
((year % 4) == 0)

See Also

Functions

•  llGetTimestamp Same format but with the time.

Articles

•  ISO 8601

Deep Notes

Signature

function string llGetDate();