I am using the RFA Java API.
My program is getting snapshots by using MarketDataSubscriber, receiving MarketDataItemEvent.
I don't use dictionary.
Field 41 CONTR_MNTH (CONTRACT MONTH) is ALPHANUMERIC, length = 4.
I want to convert the value to format dd/mm/yyyy or java.util.Date.
In example -> APR8 should be 01.04.2018
Is there a utility (method) in the API which solve this easily ?
I think the 'recommended' way now is to use Java 8 new date classes:
Thank you for your answer. The content of Field 41 can be Q121 (01/01/2021), APR8 (01.04.2018), Y20 (01/01/2020) etc. It's not a normal datepattern.
LocalDate localDate = LocalDate.parse("APR8");
java.time.format.DateTimeParseException: Text 'APR8' could not be parsed at index 0