“LlGetTimestamp”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: string llGetTimestamp( ); |参数= 参数:无 |返回值…”) |
|||
| 第29行: | 第29行: | ||
} | } | ||
} | } | ||
| − | <pre> | + | </pre> |
示例二 | 示例二 | ||
<pre> | <pre> | ||
| 第52行: | 第52行: | ||
} | } | ||
} | } | ||
| − | <pre> | + | </pre> |
2020年8月20日 (四) 10:14的版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: string llGetTimestamp( ); |
| 参数:无 |
| 返回值:以“ yyyy-mm-ddthh: mm: ss.ff. . fz”格式返回一个字符串,该字符串是 utc 时区中的当前日期和时间 |
| 注意事项 |
|---|
| All Issues ~ Search JIRA for related Bugs |
| 示例 |
|---|
示例一
// Reset tracker
string BOOT_TIME;
default
{
state_entry()
{
BOOT_TIME = llGetTimestamp(); // state_entry is triggered on script reset.
}
touch_start(integer num)
{
llSay(PUBLIC_CHANNEL, "The last script was last reset @ " + BOOT_TIME);
llSay(PUBLIC_CHANNEL, "Right now it is " + llGetTimestamp());
}
}
示例二 // Greeting
default
{
state_entry()
{
llSetTouchText("Greet");
}
touch_start(integer num)
{
list TimeStamp = llParseString2List(llGetTimestamp(),["-",":"],["T"]); //Get timestamp and split into parts in a list
integer Hour = llList2Integer(TimeStamp,4);
if(Hour<12)
llSay(PUBLIC_CHANNEL,"Good Morning, Oliver Sintim-Aboagye!");
else if(Hour<17)
llSay(PUBLIC_CHANNEL,"Good Afternoon, " + llDetectedName(0));
else
llSay(PUBLIC_CHANNEL,"Good Evening, " + llKey2Name(llDetectedKey(0)));
}
}
|
| 相关函数 |
|---|
| llGetDate--同样的格式,但没有时间。
llGetUnixTime-- 时间,以秒为单位。 llGetTime--已用脚本时间。 |
| 相关事件 |
|---|
| 无 |