Difference between revisions of "LlGetUnixTime"

From Second Life Wiki
Jump to navigation Jump to search
m (links updated)
Line 28: Line 28:
|helpers=
|helpers=
=== Helper Functions ===
=== Helper Functions ===
* [[User:Void_Singer/Functions#Unix_time_code_to_list_format|Timestamp: Unix timestamp to list format]] - ex: 1234567890 to [2009, 2, 13, 3, 31, 30]
* [[Unix2StampLst]] - Converts Unix Time stamp to a list. ex: 1234567890 to [2009, 2, 13, 3, 31, 30]
* [[User:Void_Singer/Functions#Weekday_from_Unix_timestamp|Timestamp: Weekday_from_Unix_timestamp]] - ex: "Friday" from 1234567890
* [[Unix2WeekdayStr]] - Gets the weekday from a Unix timestamp. ex: "Friday" from 1234567890
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetTimestamp]]|Human Readable UTC Date and time}}
{{LSL DefineRow||[[llGetTimestamp]]|Human Readable UTC Date and time}}

Revision as of 16:39, 12 October 2010

Summary

Function: integer llGetUnixTime( );

Returns an integer that is the number of seconds elapsed since 00:00 hours, Jan 1, 1970 "Wikipedia logo"UTC from the system clock.

Examples

<lsl> // Reset tracker integer BOOT_TIME; default {

   state_entry()
   {
       BOOT_TIME = llGetUnixTime(); 
       llSetTimerEvent(0.1);
   }
   
   timer()
   {
       llSetText((string)(llGetUnixTime() - BOOT_TIME) + " Seconds since boot.\n\n ", <1,0,0>, 1.0);
       llSetTimerEvent(1);
   }

}

</lsl>

Useful Snippets

Helper Functions

  • Unix2StampLst - Converts Unix Time stamp to a list. ex: 1234567890 to [2009, 2, 13, 3, 31, 30]
  • Unix2WeekdayStr - Gets the weekday from a Unix timestamp. ex: "Friday" from 1234567890

See Also

Functions

•  llGetTimestamp Human Readable UTC Date and time
•  llGetDate Human Readable UTC Date
•  llGetTime Elapsed script-time.

Deep Notes

All Issues

~ Search JIRA for related Issues
   llGetUnixTimeNanos() - greater precision timing mechanism

Tests

•  llGetUnixTime Conformance Test

Signature

function integer llGetUnixTime();