Difference between revisions of "LlGetTimestamp/ja"

From Second Life Wiki
Jump to navigation Jump to search
m (Undo revision 851302 by Mako Nozaki (Talk))
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
|func_id=273|func_sleep=0.0|func_energy=10.0
|func_id=273|func_sleep=0.0|func_energy=10.0
|func=llGetTimestamp|return_type=string
|func=llGetTimestamp|return_type=string
|func_footnote=ミリ秒で正確に表示します。
|func_footnote=ミリ秒の精度のようです。
|func_desc
|func_desc
|return_text="YYYY-MM-DDThh:mm:ss.ff..fZ"形式でUTCタイムゾーンでの現在の日付
|return_text="YYYY-MM-DDThh:mm:ss.ff..fZ" 形式で表現された UTC タイムゾーンでの現在の日付と時刻
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples=<lsl>// Reset tracker
|examples=<source lang="lsl2">// リセット記録


string BOOT_TIME;
string BOOT_TIME;
Line 16: Line 16:
     state_entry()
     state_entry()
     {
     {
         BOOT_TIME = llGetTimestamp(); // script restarts when SIM restarts
         BOOT_TIME = llGetTimestamp(); // スクリプトがリセットされると、state_entry が呼び起されます
     }
     }
      
      
     touch_start(integer num)
     touch_start(integer num)
     {
     {
         llSay(PUBLIC_CHANNEL, "The last system restart was @ " + BOOT_TIME);
         llSay(PUBLIC_CHANNEL, "The last script was last reset @ " + BOOT_TIME);
         llSay(PUBLIC_CHANNEL, "Right now it is " + llGetTimestamp());
         llSay(PUBLIC_CHANNEL, "Right now it is " + llGetTimestamp());
     }
     }
}</lsl>
}</source>
<lsl>// Greeting
<source lang="lsl2">// あいさつ


default
default
Line 35: Line 35:
     touch_start(integer num)
     touch_start(integer num)
     {
     {
         list TimeStamp = llParseString2List(llGetTimestamp(),["-",":"],["T"]); //Get timestamp and split into parts in a list
         list TimeStamp = llParseString2List(llGetTimestamp(),["-",":"],["T"]); //タイムスタンプを取得し、分割してリストにします
         integer Hour = llList2Integer(TimeStamp,4);
         integer Hour = llList2Integer(TimeStamp,4);
         if(Hour<12)
         if(Hour<12)
Line 44: Line 44:
             llSay(PUBLIC_CHANNEL,"Good Evening, " + llKey2Name(llDetectedKey(0)));
             llSay(PUBLIC_CHANNEL,"Good Evening, " + llKey2Name(llDetectedKey(0)));
     }
     }
}</lsl>
}</source>
|helpers
|helpers=
|also_functions={{LSL DefineRow||[[llGetDate/ja|llGetDate]]|同じ形式ですが、時間を省きます。}}
=== ヘルパー関数 ===
* [[User:Void_Singer/Functions#List_format_to_Unix_time_code.|Timestamp: list format to Unix timestamp]] - ex: [2009, 2, 13, 3, 31, 30] to 1234567890
** {{LSLG/ja|llParseString2List}}( {{LSLG/ja|llGetDate}}(), ["-"], [] ) (指定された日の最初の秒として表示される) と互換です
* [[User:Void_Singer/Functions#Weekday_from_.28_Y.2C_M.2C_D_.29_format|Timestamp: Weekday from (Y, M, D)]] - ex: "Friday" from (Y, M, D)
|also_functions=
{{LSL DefineRow||{{LSLG/ja|llGetDate}}|同じ形式ですが、時間を省きます。}}
{{LSL DefineRow||{{LSLG/ja|llGetUnixTime}}|エポック時間からの経過時間をミリ秒で表示します。}}
{{LSL DefineRow||{{LSLG/ja|llGetTime}}|スクリプトの経過時間です。}}
|also_events
|also_events
|also_tests
|also_tests
Line 52: Line 59:
{{LSL DefineRow||[http://www.cl.cam.ac.uk/~mgk25/iso-time.html ISO 8601]|}}
{{LSL DefineRow||[http://www.cl.cam.ac.uk/~mgk25/iso-time.html ISO 8601]|}}
{{LSL DefineRow||{{Wikipedia|ISO_8601}}|}}
{{LSL DefineRow||{{Wikipedia|ISO_8601}}|}}
{{LSL DefineRow||[[Code Racer]]|}} - 100回の試行での使い勝手のいいベンチマーク
{{LSL DefineRow||{{LSLG|Code Racer}}|}} - 100回の試行での使い勝手のいいベンチマーク
{{LSL DefineRow||[[Efficiency Tester]]|}} - 10,000回の試行での、さらに正確なベンチマーク
{{LSL DefineRow||{{LSLG|Efficiency Tester}}|}} - 10,000回の試行での、さらに正確なベンチマーク
{{LSL DefineRow||[[LSL_Script_Efficiency]]|}} - 効率的なテストの徹底的な議論
{{LSL DefineRow||{{LSLG|LSL_Script_Efficiency}}|}} - 効率的なテストの徹底的な議論
|notes
|notes
|cat1=Time
|cat1=Time

Latest revision as of 14:47, 25 February 2016

要約

関数: string llGetTimestamp( );

"YYYY-MM-DDThh:mm:ss.ff..fZ" 形式で表現された UTC タイムゾーンでの現在の日付と時刻を string で返します。

ミリ秒の精度のようです。

サンプル

// リセット記録

string BOOT_TIME;

default
{
    state_entry()
    {
        BOOT_TIME = llGetTimestamp(); // スクリプトがリセットされると、state_entry が呼び起されます
    }
    
    touch_start(integer num)
    {
        llSay(PUBLIC_CHANNEL, "The last script was last reset @ " + BOOT_TIME);
        llSay(PUBLIC_CHANNEL, "Right now it is " + llGetTimestamp());
    }
}
// あいさつ

default
{
    state_entry()
    {
        llSetTouchText("Greet");
    }
    touch_start(integer num)
    {
        list TimeStamp = llParseString2List(llGetTimestamp(),["-",":"],["T"]); //タイムスタンプを取得し、分割してリストにします
        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 スクリプトの経過時間です。

記事

•  ISO 8601
•  "Wikipedia logo"ISO_8601
•  Code Racer - 100回の試行での使い勝手のいいベンチマーク
•  Efficiency Tester - 10,000回の試行での、さらに正確なベンチマーク
•  LSL_Script_Efficiency - 効率的なテストの徹底的な議論

特記事項

Search JIRA for related Issues

Signature

function string llGetTimestamp();
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。