ScalaHub

Scalaj-time - a Scala Wrapper for Joda Time

Alarm clock

scalaj-time is a scala convenience wrapper around the Joda time libraries.

It provides more pleasant syntax operators: addition, subtraction and comparison, and also, fields are now available in the Scala convention, without the “get” prefix.

Here’s some example usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
import org.scala_tools.time.Imports._

DateTime.now // returns org.joda.time.DateTime

DateTime.now + 2.months // two months from now

DateTime.nextMonth < DateTime.now + 2.months // true

DateTime.now to DateTime.tomorrow // returns an org.joda.time.Interval

(1.hours + 25.minutes + 15.seconds).millis // returns org.joda.time.Duration

9.months + 3.days // returns org.joda.time.Period

scalaj-time is created by Jorge Ortiz from scalaj.