LlGetTimestamp/ja

From Second Life Wiki
< LlGetTimestamp
Revision as of 00:50, 9 May 2008 by Asuka Neely (talk | contribs) (New page: {{LSL_Function/ja |func_id=273|func_sleep=0.0|func_energy=10.0 |func=llGetTimestamp|return_type=string |func_footnote=ミリ秒で正確に表示します。 |func_desc |return_text="YYYY-...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

要約

関数: string llGetTimestamp( );

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

ミリ秒で正確に表示します。

サンプル

<lsl>// Reset tracker

string BOOT_TIME;

default {

   state_entry()
   {
       BOOT_TIME = llGetTimestamp(); // script restarts when SIM restarts
   }
   
   touch_start(integer num)
   {
       llSay(PUBLIC_CHANNEL, "The last system restart was @ " + BOOT_TIME);
       llSay(PUBLIC_CHANNEL, "Right now it is " + llGetTimestamp());
   }

}</lsl> <lsl>// 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)));
   }
}</lsl>

関連項目

関数

•  llGetDate 同じ形式ですが、時間を省きます。

記事

•  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の関連した項目が参考になるかもしれません。