Reputation: 1
I want to use the JDateChooser. and i want to get the text inside it. I saw in yt tutorials and asked my friend abt it. He told me that he can use the getText(). idk why i cant use it in mine.
tried using the getDate().toString().
but the time format is different. The time format that i chose is yyyy-MM-dd.
But the display date is Fri Jan 01 01:01:23 PST 9999
Upvotes: -2
Views: 76
Reputation: 46
Try DateFormat instead of toString() directly
DateFormat formatter = new SimpleDateFormat(yyyy-MM-dd);
formatter.format(getDate());
Upvotes: 0