I am using the Swingx JXDatePicker to enable date selection in a java application with NEtBeans.
我正在使用Swingx JXDatePicker在帶有NEtBeans的java應用程序中啟用日期選擇。
I just need the date but anytime the date is selected from the calender button, I get the date and time formatted together in this form : Sat Apr 13 00:00:00 BST 2013
我只需要日期,但無論何時從日歷按鈕中選擇日期,我都會以這種形式格式化日期和時間:Sat Apr 13 00:00:00 BST 2013
however , I just want to have the date and not the time.
但是,我只想擁有日期,而不是時間。
that is in a form like : Sat Apr 13 2013 or any other form without the time included
這是一種形式:2013年4月13日星期六或任何其他形式沒有包括時間
Is there a way to trim the default format to have just the date.
有沒有辦法修剪默認格式只有日期。
thank you all.
謝謝你們。
1 个解决方案
#1
-1
You can try this:
你可以試試這個:
DateFormat df = DateFormat.getDateInstance();
String fromdate = df.format(txt_fromdate.getDate());