与Java.Time.localdate和Java.Time.LocalTime或Java.Time.LocaldateTime构建org.joda.time.time.datetime
因此,基本上我有一个datepicker和timepicker,分别将为我提供一个本地日期和本地时间。现在,我想使用这些值来制作org.joda.time.datetime变量。
我不确定该怎么做。我到处都看,但找不到我发现的所有答案的好答案,都是我不使用的JPA。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据官方文档, https:///www.joda。 org/joda time/apidocs/org/joda/time/dateTime.html
您可以使用
dateTime(int年,int int oferof yrofmear,int dayofmonth,int hourofday,int suncerofhour,int secondofminute,int millisofsecond)
在默认时区中使用等级学从DateTime字段值构建实例。
构造函数的值可以从localdate和localtime对象获得
As per official documentation https://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html
you can use
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
Constructs an instance from datetime field values using ISOChronology in the default time zone.
The values for the constructor can be obtained from LocalDate and Localtime object
https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html
https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html