Time()

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » Time() Version 2.2

説明

Time 関数は、ステーションがオンになっている時間(秒単位)を数値(float)で返します。基本的には、grandMA3 アプリケーションの起動時に開始されるストップウォッチです。現在時刻やセッションのオンラインタイムではありません。

引数

この関数は、引数を受け取りません。

戻り値

  • number:
    ステーションのオンタイムを表す数値(float)を返します。

書式指定してタイムを表示します。

Lua
return function()
    -- Get the current time
    local time = Time()
    --Calculate the different elements
    local days = math.floor(time/86400)
    local hours = math.floor((time % 86400)/3600)
    local minutes = math.floor((time % 3600)/60)
    local seconds = math.floor(time % 60)
    --Print the result
    Printf("The time is %d:%02d:%02d:%02d", days, hours, minutes, seconds)
end