0

It was working before on my other computer but now the date is not changing. I get the date from JDateChooser:

if(txt_date_creation.getDate()!=null){
    q.setDate("dc",txt_date_creation.getDate());
}

And this is the format that I'm using:

dd/MM/yyyy

And the output is:

Tue Apr 13 00:00:00 BST 2021
Abra
  • 19,142
  • 7
  • 29
  • 41
  • If you can find a date picker that supports java.time, the modern Java date and time API, then discard the `Date` class completely. It is poorly designed and long outdated. BTW the output you get comes from `Date.toString()`. – Ole V.V. Apr 13 '21 at 17:01
  • Does this answer your question? [display Java.util.Date in a specific format](https://stackoverflow.com/questions/6262310/display-java-util-date-in-a-specific-format). Does [this](https://stackoverflow.com/questions/18628059/change-the-format-of-date-java)? [This](https://stackoverflow.com/questions/35913647/format-a-date-and-returning-a-date-not-a-string)? [This](https://stackoverflow.com/questions/50485203/return-date-type-with-format-in-java)? – Ole V.V. Apr 13 '21 at 18:22
  • Is `txt_date_creation` your `JDateChooser`? – Ole V.V. Apr 13 '21 at 18:25
  • i dont know im gonna try it – abdellah labied Apr 14 '21 at 09:43
  • yes txt_date_chooser is my jdatechooser – abdellah labied Apr 14 '21 at 09:44
  • and i try to use simplleDateformat and it give's me the same output, – abdellah labied Apr 14 '21 at 09:46

0 Answers0