Difference between revisions of "LlGetInventoryAcquireTime"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
Rider Linden (talk | contribs) (Created page with "{{LSL_Function |inject-2={{LSL_Function/inventory|item|uuid=false}} |func_sleep=0.0|func_energy=10.0 |func=llGetInventoryAcquireTime|return_type=string|p1_type=string|p1_name=...") |
m (Added information about format and precision.) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
|func_footnote | |func_footnote | ||
|func_desc | |func_desc | ||
|return_text= | |return_text=with the timestamp that the item was added to the prim's inventory. | ||
The time is in the UTC time zone in the format "YYYY-MM-DDThh:mm:ssZ" | |||
Appears to be accurate to seconds. | |||
|spec | |spec | ||
|caveats= | |caveats= | ||
*This function currently returns an ISO timestamp that is missing milliseconds. It is recommended that you code your applications in preparation of millisecond support being added at a later date. | |||
*Using [[llListSort]] to sort a list of timestamps that both include and exclude milliseconds will have undesired results. ".000000" will first have to be inserted into timestamps missing milliseconds. | |||
|constants | |constants | ||
|examples= | |examples=If there is no other item in the inventory, you get the timestamp from the script itself. | ||
<source lang="lsl2">default | |||
{ | |||
state_entry() | |||
{ | |||
llSay(0, "Hello, Avatar!"); | |||
} | |||
touch_start(integer total_number) | |||
{ | |||
string item = llGetInventoryName(INVENTORY_ALL, 0); // 0 means the first item in prim's inventory. | |||
string timestamp = llGetInventoryAcquireTime(item); | |||
llSay(0, "Timestamp for: " + item + " - " + timestamp); // output | |||
} | |||
}</source> | |||
|helpers | |helpers | ||
|also_functions= | |also_functions= | ||
{{LSL DefineRow||[[llGetTimestamp]]|Returns the current timestamp using the same format}} | |||
{{LSL DefineRow||[[llGetInventoryCreator]]|Returns the inventory item's creator}} | {{LSL DefineRow||[[llGetInventoryCreator]]|Returns the inventory item's creator}} | ||
{{LSL DefineRow||[[llGetInventoryName]]|Returns the inventory item's name}} | {{LSL DefineRow||[[llGetInventoryName]]|Returns the inventory item's name}} |
Latest revision as of 04:55, 7 October 2023
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: string llGetInventoryAcquireTime( string item );? | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a string with the timestamp that the item was added to the prim's inventory.
The time is in the UTC time zone in the format "YYYY-MM-DDThh:mm:ssZ"
Appears to be accurate to seconds.
• string | item | – | an item in the inventory of the prim this script is in |
Caveats
- If item is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
- This function currently returns an ISO timestamp that is missing milliseconds. It is recommended that you code your applications in preparation of millisecond support being added at a later date.
- Using llListSort to sort a list of timestamps that both include and exclude milliseconds will have undesired results. ".000000" will first have to be inserted into timestamps missing milliseconds.
Examples
If there is no other item in the inventory, you get the timestamp from the script itself.
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
string item = llGetInventoryName(INVENTORY_ALL, 0); // 0 means the first item in prim's inventory.
string timestamp = llGetInventoryAcquireTime(item);
llSay(0, "Timestamp for: " + item + " - " + timestamp); // output
}
}
See Also
Functions
• | llGetTimestamp | – | Returns the current timestamp using the same format | |
• | llGetInventoryCreator | – | Returns the inventory item's creator | |
• | llGetInventoryName | – | Returns the inventory item's name | |
• | llGetInventoryType | – | Tests to see if an inventory item exists and returns its type | |
• | llGetInventoryNumber | – | Returns the number of items of a specific type in inventory | |
• | llGetInventoryPermMask | – | Returns the inventory item's permissions | |
• | llGetInventoryKey | – | Returns the inventory item's UUID (if full perm) |