Difference between revisions of "LlGetUnixTime/test"

From Second Life Wiki
Jump to navigation Jump to search
m (lsl code tagging)
Line 7: Line 7:
|lindensig=
|lindensig=
|lindensigner=
|lindensigner=
|text=<pre>
|text=
<lsl>
default
default
{
{
Line 21: Line 22:
     }
     }
}
}
</pre>
</lsl>
|instructions=
|instructions=
# Put this script on an object in world
# Put this script on an object in world

Revision as of 23:44, 12 April 2008



Purpose

Scripts to test the conformance of the llGetUnixTime function.

 

Scripts


llGetUnixTime test #1

Status: draft

Introduction

First test, copied from the Second Life KB

Script text

<lsl> default {

   touch_start(integer total_number)
   {
       string time;
       float ft = llGetGMTclock();
       integer ut = llGetUnixTime();
       integer hours = llFloor(ft / 3600);
       integer minutes = llFloor((ft - (hours*3600)) / 60.0);
       time = (string)hours+ ":" + (string)minutes + ":" + (string)(llFloor(ft) % 60);
       llOwnerSay("This object was touched at " + llGetDate() + "  " + time + ".  Unix time = " + (string)ut);
   }

} </lsl>

Authorized Signature: (none) by (none)

Instructions

  1. Put this script on an object in world
  2. Touch the object
  3. Copy the number after 'Unix time ='
  4. Paste the number into the Timestamp box on http://www.4webhelp.net/us/timestamp.php
  5. Press 'Convert to a date'
  6. Verify the date shown near the top of the web page matches the date and time said by the box
  7. Repeat steps 2 -> 6 a few times

Events Used

Notes