0

I am trying to convert string "20190207000115" into DateTime format like 2019-02-07 00:01:15 in java.

Is there any method in java to convert into day time format like this ? So far I found in C# but not in java.

Please help me

Rama
  • 815
  • 2
  • 17
  • 37
  • 1
    Use `java.time.format.DateTimeFormatter` . – Mark Schäfer Oct 22 '19 at 08:03
  • Thanks Mark for reply, Can you please share code syntax ? – Rama Oct 22 '19 at 08:13
  • 1
    @user3302083 Search and you shall find. However, `LocalDateTime.parse("20190207000115", DateTimeFormatter.ofPattern("uuuuMMddHHmmss"))` yields a `LocalDateTime` of `2019-02-07T00:01:15`. If you want it printed in a different format, for example without the `T` in the middle, use a second `DateTimeFormatter`. Search for how. – Ole V.V. Oct 22 '19 at 08:27

0 Answers0