Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.cubicle6.time.test
- import java.util.Calendar
- import com.cubicle6.time._
- import com.cubicle6.time.Instant._
- import com.cubicle6.time.Duration._
- object Usage {
- def main(args: Array[String]): Unit = {
- val d1: Duration = 1.minute
- val d2: Duration = 1.second and 17.milliseconds
- val d3: Duration = 2.days and 3.hours
- val d4: Duration = 3.minutes
- val d6: Duration = 2.days + 3.hours + 17.minutes
- val i1: Instant = now
- val i2: Instant = i1 + d1
- val i3: Instant = Calendar.getInstance()
- val i4: Instant = tomorrow
- val i5: Instant = now - 2.days
- val i6: Instant = 2.days + 3.hours + 17.minutes from now
- val i7: Instant = 2.days and 17.minutes ago
- val i8: Instant = 3.minutes from yesterday
- val i9: Instant = 1.minute ago
- val i10: Instant = tomorrow + 1.day
- val i11: Instant = 1.day + tomorrow
- println(i1)
- println(d1)
- println(i2)
- }
- }
Add Comment
Please, Sign In to add comment