Updated on 2026-05-12 GMT+08:00

Conversion Between Datetime Objects and Unix Timestamps

  • Processing functions
    • To convert a Unix timestamp to a datetime string, use the dt_parse function.
    • The tz parameter in the e_set function converts a datetime object without a time zone to one with a time zone, or converts the original time zone to the target time zone.
  • Convert a Unix timestamp to a datetime string object with a time zone.
    • Raw log
      {
          "time": 1562741899
      }
    • Processing rule
      e_set("new_time", dt_parse(v("time"), tz="Asia/Shanghai"))
    • Processing result
      {
      	"new_time": "2019-07-10 14:58:19+08:00",
      	"time": 1562741899
      }