I extract DATE information from Oracle Database in two different ways: by query and by stored procedure. I read the value by
String day = rs.getString("DAY");
obtaining:
by query: 2017-01-01 00:00:00:0
by stored procedure: 01-JAN-17
I need to convert them in a unique format, that is
yyyy-MM-dd
I do not know in advance how the value will be extracted (query or stored), so I do not know in advance which is the format.
Is there a generic way to convert in the target format? I'm looking for a way to convert two different input strings in a common output format
In other words, I need a "black box" code that, given in input a unknown string, converts it in yyyy-MM-dd.
Thanks