1

i have question about how to parse data i have here the example

52=2020-04-02T06:07:23.213

what i expected get value

1. 2020-04-02
2. 2020-04-02 06:07:23.213

how to get them using parse and substring ? because i want to save the data for format like this

EUR/USD|1.09595|2020-04-02 06:07:23.213 and EUR/USD|2020-04-02.text

regards,

Fuad

fuad trix
  • 33
  • 8

1 Answers1

1

You can use SimpleDateFormat in java

Date date = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.S").parse("2020-04-02T06:07:23.213");
System.out.println(new SimpleDateFormat("yyyy-MM-dd").format(date));
System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S").format(date));
Dickens A S
  • 3,824
  • 2
  • 22
  • 45