how to retrieve a set of objects based on time attribute?
0
Hi guys, what's the best way to retrieve a list of objects constrained by a datetime attribute, but only based on the time not the date (e.g. all objects stored with time stamp of 23:00:00, independent of what date they've been stored). This without using a java action. We basically need to apply a fix due to some issue with UTC formatting and I cannot see an adequate function to just grab the appropriate objects. I was trying to grab the value as a string, but some functions are not available on retrieve activity (or with a date argument). LR.
asked
Luis Rodrigues
2 answers
1
Luis
Are you trying to do this in XPath? Have you tried hours-from-dateTime (documentation here? If so, where did you run into problems with that? Just trying to understand more what you need to accomplish and what you've tried.
Mike
answered
Mike Kumpf
1
Luis,
You have to itterate over all the objects. You should do the custom retrieve with limits and offset so you handle let's say 100 objects at a time. When you iterate over the objects you can then check the time of the attribute ( see the documentation here to see how to get the hour as integer: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
If the time is wrong adjust it otherwise continue with the next iteration.
Hope this helps,