I'm communication with a web service and it the json response has dates in it. the problem is those dates are in different formats. is there a generic way to parse these strings?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You should probably have an ordered list of formats to try (ideally using Joda Time as a far better API than the built-in one) and try each in turn until one works. It's not ideal in terms of performance (all the exceptions for failure) but it'll work and should be reasonably clear.
Of course, if you can get in touch with the web service provider and suggest that they return a standard format instead, that would be cleaner...