1) Give a description of the problem
I have a piston that’s retrieving a response from a 3rd-party web service. One of the fields from that service is a date and time in ISO 8601 format. I’m trying to convert it into a webCoRE datetime format, but it’s ignoring the time zone and dropping the seconds. As I was testing things, I discovered that the same thing happens if I take time($now)
, convert it to a string, and then try to convert it back to a time. Is there a better way to convert a string to a time that preserves all of the data?
2) What is the expected behavior?
Converting a time to a string and then back to a time should produce the same as the original value, including the seconds, microseconds, and time zone.
3) What is happening/not happening?
If I take time($now)
, convert it to a string using string(time($now))
, then convert it back to a time using time(string(time($now)))
, the result is different from the original time value.
4) Post a Green Snapshot of the piston!!
5) Attach any logs
+1ms ╔Received event [Home].test = 1536542374231 with a delay of 0ms +99ms ║RunTime Analysis CS > 17ms > PS > 69ms > PE > 13ms > CE +102ms ║Runtime (39391 bytes) successfully initialized in 69ms (v0.3.108.20180906) (100ms) +104ms ║╔Execution stage started +112ms ║║Cancelling statement #1's schedules... +124ms ║║Executed virtual command setVariable (4ms) +140ms ║║8:19:34 PM CDT +142ms ║║Executed virtual command log (2ms) +165ms ║║3:19:00 PM CDT +166ms ║║Executed virtual command log (2ms) +172ms ║╚Execution stage complete. (68ms) +174ms ╚Event processed successfully (173ms)