1

I got this problem in my code. I want to show a date in dd/mm/yy, for example 04/11/19.I don't know how to do it, I tried something like this:

new SimpleDateFormat("dd/mm/yy").format(getDate())

But it does mm/dd/yyyy. This is my code I tried to format:

for (Information t : list) {
    tblInfo.addItem(
       new Object[] { t.getName(), t.getLocation(), t.getTypeProduct().getDescription(), new SimpleDateFormat("dd/mm/yy").format(t.getTodayDate) }, null
    );
}
ICodeForCaffeine
  • 195
  • 2
  • 10
BlackoutDev
  • 107
  • 1
  • 7

1 Answers1

2

Try this Date date = new SimpleDateFormat("yyyy-MM-dd").parse(getDate);