Guest User

Untitled

a guest
Jun 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. package com.cubicle6.time.test
  2.  
  3. import java.util.Calendar
  4.  
  5. import com.cubicle6.time._
  6. import com.cubicle6.time.Instant._
  7. import com.cubicle6.time.Duration._
  8.  
  9. object Usage {
  10.  
  11. def main(args: Array[String]): Unit = {
  12.  
  13. val d1: Duration = 1.minute
  14. val d2: Duration = 1.second and 17.milliseconds
  15. val d3: Duration = 2.days and 3.hours
  16. val d4: Duration = 3.minutes
  17. val d6: Duration = 2.days + 3.hours + 17.minutes
  18.  
  19. val i1: Instant = now
  20. val i2: Instant = i1 + d1
  21. val i3: Instant = Calendar.getInstance()
  22. val i4: Instant = tomorrow
  23. val i5: Instant = now - 2.days
  24. val i6: Instant = 2.days + 3.hours + 17.minutes from now
  25. val i7: Instant = 2.days and 17.minutes ago
  26. val i8: Instant = 3.minutes from yesterday
  27. val i9: Instant = 1.minute ago
  28. val i10: Instant = tomorrow + 1.day
  29. val i11: Instant = 1.day + tomorrow
  30.  
  31. println(i1)
  32. println(d1)
  33. println(i2)
  34. }
  35. }
Add Comment
Please, Sign In to add comment