Joda-Time: DateTime, DateMidnight and LocalDate usage

Posted by fraido on Stack Overflow See other posts from Stack Overflow or by fraido
Published on 2010-03-29T14:05:46Z Indexed on 2010/04/17 14:13 UTC
Read the original article Hit count: 488

Joda-Time library includes different datetime classes

DateTime - Immutable replacement for JDK Calendar
DateMidnight - Immutable class representing a date where the time is forced to midnight
LocalDateTime - Immutable class representing a local date and time (no time zone)

I'm wondering how are you using these classes in your Layered Applications.

I see advantages in having almost all the Interfaces using LocalDateTime (at the Service Layer at least) so that my Application doesn't have to manage Timezones and can safely assume Times always in UTC. My app could then use DateTime to manage Timezones at the very beginning of the Execution's Flow.

I'm also wondering in which scenario can DateMidnight be useful.

© Stack Overflow or respective owner

Related posts about jodatime

Related posts about java