How to convert Joda time LocalTime to java.util.Date?

£可爱£侵袭症+ 提交于 2019-12-04 19:36:28
Date da = loct.toDateTimeToday().toDate();  

Have you tried

locd.withFields(loct).toDate();

You can also use this--

Date dtUtil = DateTime.now(DateTimeZone.getDefault()).toDate();

the generic way is -

Date dtUtil = DateTime.now(DateTimeZone.forID("TimeZoneString")).toDate();

where "TimeZoneString"is timeZone id for which you want to get the time.

DateTimeZone.getDefault() will return the local zone of the system.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!