<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlGetDate</id>
	<title>LlGetDate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.osgrid.org/index.php?action=history&amp;feed=atom&amp;title=LlGetDate"/>
	<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlGetDate&amp;action=history"/>
	<updated>2026-10-25T11:12:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://wiki.osgrid.org/index.php?title=LlGetDate&amp;diff=130&amp;oldid=prev</id>
		<title>Osgridadmin: Created page with &quot;== Function: string llGetDate( );== Returns a string that is the current date in the UTC time zone in the format &quot;YYYY-MM-DD&quot;. &lt;br&gt; If you wish to know the time as well use: [...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.osgrid.org/index.php?title=LlGetDate&amp;diff=130&amp;oldid=prev"/>
		<updated>2017-12-31T22:18:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Function: string llGetDate( );== Returns a string that is the current date in the UTC time zone in the format &amp;quot;YYYY-MM-DD&amp;quot;. &amp;lt;br&amp;gt; If you wish to know the time as well use: [...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Function: string llGetDate( );==&lt;br /&gt;
Returns a string that is the current date in the UTC time zone in the format &amp;quot;YYYY-MM-DD&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
If you wish to know the time as well use: [[llGetTimestamp]] which uses the format &amp;quot;YYYY-MM-DDThh:mm:ss.ff..fZ&amp;quot; &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Examples&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Birthday surprise&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {   &lt;br /&gt;
        llSetTimerEvent(0.1);&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        if(llGetDate() == &amp;quot;2009-02-15&amp;quot;)&lt;br /&gt;
            llSetText(&amp;quot;HAPPY BIRTHDAY!&amp;quot;, &amp;lt;0,1,0&amp;gt;, 1.0);&lt;br /&gt;
        else&lt;br /&gt;
            llSetText(&amp;quot;A surprise is coming...&amp;quot;, &amp;lt;0,1,0&amp;gt;, 1.0);&lt;br /&gt;
 &lt;br /&gt;
        llSetTimerEvent(3600.0);  // check every hour. &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Function to calculate the numeric day of year&lt;br /&gt;
integer dayOfYear(integer year, integer month, integer day)&lt;br /&gt;
{&lt;br /&gt;
    return day + (month - 1) * 30 + (((month &amp;gt; 8) + month) / 2)&lt;br /&gt;
        - ((1 + (((!(year % 4)) ^ (!(year % 100)) ^ (!(year % 400))) | (year &amp;lt;= 1582))) &amp;amp;&amp;amp; (month &amp;gt; 2));&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_end(integer count)&lt;br /&gt;
    {&lt;br /&gt;
        list dateComponents = llParseString2List(llGetDate(), [&amp;quot;-&amp;quot;], []);&lt;br /&gt;
        integer year  = (integer) llList2String(dateComponents, 0);&lt;br /&gt;
        integer month = (integer) llList2String(dateComponents, 1);&lt;br /&gt;
        integer day   = (integer) llList2String(dateComponents, 2);&lt;br /&gt;
        llSay(0, &amp;quot;The current day of the year is &amp;quot; + (string) dayOfYear(year, month, day));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Function to calculate whether a current year is a leap year&lt;br /&gt;
 &lt;br /&gt;
integer is_leap_year( integer year ) &lt;br /&gt;
{     &lt;br /&gt;
    if( year % 4 )         return FALSE;   // Not a leap year under any circumstances     &lt;br /&gt;
    if( year &amp;lt;= 1582 )     return TRUE;    // In the Julian calender before 24 February 1582, every fourth year was a leap year&lt;br /&gt;
    if( !( year % 400 ))   return TRUE;    // A leap century is a leap year if divisible by 400 &lt;br /&gt;
    if( !( year % 100 ))   return FALSE;   // Any other century is not a leap year  &lt;br /&gt;
    return TRUE;                           // It is divisible by 4 and not a century and not Julian, therefore it is a leap year&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
See Also &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions&amp;#039;&amp;#039;&amp;#039; &amp;lt;br&amp;gt;&lt;br /&gt;
•  	[[llGetTimestamp]] 	– 	Same format but with the time. 	 &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Osgridadmin</name></author>
	</entry>
</feed>