Archives: Date Time

Java – Convert Util Date to Joda DateTime

Convert Java Util Date to Joda DateTime

Make sure date isn’t null, though, otherwise it acts like new new DateTime()



Java – Date Sorting Example

Java Date Sort Example

This example will sort Date objects and provide ascending order. This class used for sorting dates using Calendar and Date class.



Java – Convert Milliseconds to Date

Converting Milliseconds to Date in Java – Millis to Date Example

Output:

current Date: Wed Feb 29 01:58:46 VET 2012
Milliseconds to Date: 29:02:12:01:58:46
Milliseconds to Date using Calendar:29:02:12:01:58:46
original Date: 29:02:12:01:58:46
copied Date: 29:02:12:01:58:46