DateTime():local()
DateTime オブジェクトのタイムゾーンをシステムのデフォルトのローカルタイムゾーンに変換します。
シグネチャ
local(): DateTime
戻り値
- 型:
DateTime - 現在の
DateTimeインスタンス。タイムゾーンがローカルのデフォルトに設定され、メソッドチェーンが可能です。
例
local now = DateTime()
-- 現在のシステムタイムゾーンが UTC ではないと仮定
now:utc()
toast("UTC time: " .. now:format("yyyy-MM-dd HH:mm:ss Z"))
now:local()
toast("Local time: " .. now:format("yyyy-MM-dd HH:mm:ss Z"))