Difference between revisions of "LlGetUnixTime"
Jump to navigation
Jump to search
Omei Qunhua (talk | contribs) m (add helper function links) |
m (<lsl> tag to <source>) |
||
Line 9: | Line 9: | ||
|caveats | |caveats | ||
|constants | |constants | ||
|examples=< | |examples=<source lang="lsl2"> | ||
// Reset tracker | // Reset tracker | ||
integer BOOT_TIME; | integer BOOT_TIME; | ||
Line 26: | Line 26: | ||
} | } | ||
} | } | ||
</ | </source> | ||
|helpers= | |helpers= | ||
=== Helper Functions: === | === Helper Functions: === |
Revision as of 02:06, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: integer llGetUnixTime( );0.0 | Forced Delay |
10.0 | Energy |
Returns an integer that is the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC from the system clock.
Examples
// 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);
}
}
Useful Snippets
Helper Functions:
• | Unix2StampLst | – | Converts Unix Time stamp to a list. ex: 1234567890 to [2009, 2, 13, 23, 31, 30] | |
• | Stamp2UnixInt | – | Converts date to Unix Time stamp. ex: [2009, 2, 13, 23, 31, 30] to 1234567890 | |
• | uuLinuxTime | – | Converts date to Unix Time stamp (from Linux kernel's sources) | |
• | Unix2WeekdayStr | – | Gets the weekday from a Unix Time stamp. ex: "Friday" from 1234567890 | |
• | Unix2PST_PDT | – | Converts Unix Time stamp to an SLT date/time string with PST or PDT indication as appropriate | |
• | Unix2GMTorBST | – | Converts Unix Time stamp to a UK date/time string with GMT or BST indication as appropriate |
See Also
Functions
• | llGetTimestamp | – | Human Readable UTC Date and time | |
• | llGetDate | – | Human Readable UTC Date | |
• | llGetTime | – | Elapsed script-time. |