java.util.Date date = ...
DateTime dateTime = new DateTime(date);
Make sure date
isn’t null
, though, otherwise it acts like new DateTime()
– I really don’t like that.
More Related Contents:
- Converting a date string to a DateTime object using Joda Time library
- How to calculate elapsed time from now with Joda-Time?
- Differences between Java 8 Date Time API (java.time) and Joda-Time
- Parse Date String to Some Java Object
- Time: How to get the next friday?
- GPS Time Representation library
- Java-How to calculate accurate time difference while using Joda Time Jar
- Convert Date/Time for given Timezone – java
- Convert java.util.Date to what “java.time” type?
- SimpleDateFormat producing wrong date time when parsing “YYYY-MM-dd HH:mm”
- How to find difference between two Joda-Time DateTimes in minutes
- How to convert a String to a Date using SimpleDateFormat?
- Unable to obtain LocalDateTime from TemporalAccessor when parsing LocalDateTime (Java 8)
- How to get milliseconds from LocalDateTime in Java 8
- What is the use of “lenient “?
- How to change TIMEZONE for a java.util.Calendar/Date
- In Java, how do I get the difference in seconds between 2 dates?
- How can I create a Java 8 LocalDate from a long Epoch time in Milliseconds?
- last day of month calculation
- Comparing time is incorrect when picking 12:00
- Mocking time in Java 8’s java.time API
- Get the week start and end date given a current date and week start
- How to compare two dates along with time in java
- How to transform currentTimeMillis to a readable date format? [duplicate]
- How to convert date time from one time zone to another time zone
- Java Best Practice for Date Manipulation/Storage for Geographically Diverse Users
- Convert date into AEST using java
- Android get Current UTC time [duplicate]
- hibernate 4 and joda-time
- Is SimpleDateFormat in Java work incorrect or I did any mistake? See code sample [duplicate]