LlGetTimestamp

来自人工智能助力教育知识百科
跳转至: 导航搜索

Template:Needs Translation/


函数名
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--已用脚本时间。

相关事件