Difference between revisions of "LlGetDate"
Jump to navigation
Jump to search
m |
m |
||
Line 2: | Line 2: | ||
|func_id=204|func_sleep=0.0|func_energy=10.0 | |func_id=204|func_sleep=0.0|func_energy=10.0 | ||
|func=llGetDate|sort=GetDate|return_type=string | |func=llGetDate|sort=GetDate|return_type=string | ||
|func_footnote=If you wish to know the time as well use: [[llGetTimestamp]] which uses the format | |func_footnote=If you wish to know the time as well use: [[llGetTimestamp]] which uses the format {{NoWrap|"YYYY-MM-DDThh:mm:ss.ff..fZ"}} | ||
|func_desc | |func_desc | ||
|return_text=that is the current date in the UTC time zone in the format "YYYY-MM-DD". | |return_text=that is the current date in the UTC time zone in the format {{NoWrap|"YYYY-MM-DD"}}. | ||
|spec | |spec | ||
|caveats | |caveats |
Revision as of 14:08, 15 July 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: string llGetDate( );204 | Function ID |
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"
Caveats
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 + (((month > 8) + month) / 2)- ((1 + (((!(year % 4)) ^ (!(year % 100)) ^ (!(year % 400)))