java jxdatepicker_在Java Swingx中修剪JXDatePicker

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());

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值