Select to view content in your preferred language

ISO8601 as date and time field.

188
1
07-15-2024 12:55 PM
MattTarkington1
Occasional Contributor

Hello Fellow Velocity users,

I have a feed that I'm trying to ingest from a vendor that uses the IS80601 date format: "yyyy-MM-ddTHH:mm:ss.fffZ". example:

"2024-07-10T20:34:55.2724781+00:00"
 
I haven't been able to get velocity to  recognize this as a date field. According to this article I figured I could just replace the 'f' with 'S' and it would work, but no luck.
 
I think I'll end up using the Split function to remove everything after the period, convert to a date and manually adjust for time zone.
 
I just figured I'd see if anyone out there in the GISphere had any suggestions.
 
Cheers,
 
Matt
 
PS. Although not necessarily the solution I was looking for... I tested the Split and Date function and it... works.
 
var SplitTime = Split($feature.lastComms, ".")
return Date(SplitTime[0])
 
Returns: Jul 10, 2024, 8:34:55 PM Mountain Daylight Time in the field calculator.
 
returns Unix time in sample or compare node.
 
Map viewer seems to be converting unix successfully to a human readable format.
1 Reply
JeffSilberberg
Frequent Contributor

With Arcade Release 1.26 in February 2024, there were some new Date/Time capabilities in Arcade. 

https://developers.arcgis.com/arcade/guide/release-notes/