Date and Time Split Across Multiple Fields

09-25-2013 04:55 AM
New Contributor II

Is there any easy way to handle a tcp feed where the date and time are split across multiple fields, or would a custom connector have to be written. Currently the incoming feed looks like this:

Year  Month Day Hour Minute Second NanoSecond
2013 5 31 0 0 22 621310393

And ideally I would like a timestamp field.

Vassilo Walluschnig
Esri South Africa
0 Kudos
1 Reply
Esri Regular Contributor
Hello Vassilo,

No, there is no easy way to do what I think you are wanting to do, for two reasons:

1) At the 10.2.0 release the input connector you are most likely using (Text/TCP) does not support ASCII space characters as field delimiters. We expanded the adapter for this connector at 10.2.1 to add support for using any unicode character as a field delimiter, but unless you have some influence over the feed provider and can get the data as comma separated values (for example) you will have trouble at 10.2.0 getting the day/month/year/hour/minute/second values as separate Integer values.

2) The feed currently has separate values for "months" and "days". Using a Field Calculator you can add a number of milliseconds (as a Long) to a value from a Date field to compute a relative value. For example, the expression DateTime + (8 * 3600 * 1000) would add "8 hours worth of milliseconds" to the value currently in the field DateTime, advancing the value by eight hours. The problem is that there is no easy way to adding N months to a Date value using the Field Calculator. You would have to lookup the number of days in each month and count up the total number of days in however many months you have ... and then add "NN days worth of milliseconds" to an established Date value.

We are looking for common functions needed in Field Calculator. A DateAdd() Function like what is found in Visual Basic might be useful here. It would be helpful if you could visit and post the ideas you have for GeoEvent Processor. The more votes a particular idea gets the easier it is to prioritize an enhancement. When you do post an idea, please be sure to enter "GeoEvent Processor" as a tag value and check the 'ArcGIS Server' category. This will help route the idea to the team.

Best Regards -
0 Kudos