跳至主要內容

時間戳轉換為 RFC 3339 格式文字 (utils.date_to_rfc3339)

聲明

rfc3339 = utils.date_to_rfc3339(timestamp)

參數

  • timestamp
    數值型,時間戳

回傳值

  • rfc3339
    文字型,RFC 3339 格式的時間文字

說明

該函式在 20250220 以後版本方可使用

範例

nLog(utils.date_to_rfc3339(1749490800)) -- 輸出:2025-06-09T17:40:00.000Z  
nLog(utils.date_to_rfc3339(os.time())) -- 輸出類似:2025-06-09T17:40:00.000Z