0

I've a JSON response and returns me String "30-05-2020 12:02:29" . In javascript how can i make this string to convert datetime ?

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
  • You have a couple options: 1. Use the `Date` class. Something like `var d = new Date(string_val);` 2. Use moment.js. Since you're returning a format somewhat abnormal, you can use that to specify the contents. – user3832673 Apr 14 '21 at 13:34
  • 2
    We are of course assuming you actually meant JavaScript, as you typed in the title and in the question text, not Java, as you tagged the question. Java != JavaScript, and it would behoove you to learn the name of the language you're writing code in. – Andreas Apr 14 '21 at 13:35
  • Although if the JSON response comes from JAVA, perhaps it is the server response that is worth changing – mplungjan Apr 14 '21 at 13:59

0 Answers0