Select to view content in your preferred language

Date Format: Other time stamp formatter flexibility?

216
4
4 weeks ago
Teresa_Blader
Occasional Contributor III

Sometimes a feed doesn't always follow the exact same time format for seconds and milliseconds and how many decimal points it has in a single date field. Velocity then seems to ignore the time stamp when it doesn't follow the specified formatting, leaving date field blank, unless it matches.

The first return row has a timestamp with 9 decimals however, not all of the data has 9 decimals, most don't have any decimals. Everything has seconds at least.

"2024-06-28T19:13:00Z"
"2024-06-28T19:05:52.502140873Z"
 

Is there something I am missing? Should I be using a specific notation when it's like this? The documentation provided didn't seem to discuss rogue timestamps. I wouldn't mind it rounding up to seconds, but I at least want it to pass through.

Teresa_Blader_0-1719600820796.png

Two rows don't get a date.... the others do:

Teresa_Blader_1-1719604358142.png

 

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
4 Replies
JeffSilberberg
Occasional Contributor III

@Teresa_Blader 

   I have found that doing this is a Field calculation within the analytic makes more sense and results in better consistency in data than doing it in the Feed.  You can do an Arcade function to make the correct decisions and build the date you want.  

 In 5.1 Esri introduced a number of new Date functions and Types as well as synced Arcade and Velocity.   The new Date functions have helped a lot, I have yet to figure out how to use the new Date Types within Velocity.  

 

0 Kudos
PeterNasuti
Esri Contributor

@Teresa_Blader I agree with @JeffSilberberg's suggestion above. Using the Map Fields tool for a field calculation depending on string length (or just using the text slicing to grab the correct elements) would be a better solution and can assign the "Start Time" tag. This could be a combination of the IIf function, Date function, etc. to parse the date correctly 

The Velocity feeds and sources "date format" is expecting a single consistent date format. The behavior you are seeing is as designed where if the string can't be parsed to the date format the value is nulled.

0 Kudos
Teresa_Blader
Occasional Contributor III

Thanks for the responses Peter and Jeff!

So..... I would then be setting up the feed to not have a start time? Isn't that kind of integral to the feed? Instead I'll just set the dates as a string, not date, and then add the date with the real-time analytic with map fields?

Sadly, I'm basically full on my subscription so I was hoping to just use the feed in my maps. I kinda wonder, since there's almost always a real-time analytic associated to every feed, especially with stuff like this - if a feed + one real-time analytic could equal one mark on the subscription. I have another feed that the API will randomly send through a weird time stamp and that just gets nulled, but I've just been kinda ignoring it.

Teresa Blader
Olmsted County GIS Specialist
0 Kudos
JeffSilberberg
Occasional Contributor III

Yes, No Start Time.  Do that in the Field Mapper. 

I am not really sure what to tell you about credits. Other than to talk to your Esri account team.  

 

 

0 Kudos