Skip to content

Instantly share code, notes, and snippets.

@miensol
Created November 13, 2020 14:07
Show Gist options
  • Save miensol/4fde0ac4aa0fab679687fb651c3c8cf2 to your computer and use it in GitHub Desktop.
Save miensol/4fde0ac4aa0fab679687fb651c3c8cf2 to your computer and use it in GitHub Desktop.
import org.joda.time.DateTime
import org.joda.time.Minutes
val now = DateTime.now()
val past = now.minusMinutes(3)
println(Minutes.minutesBetween(past, now).minutes)
println(Minutes.minutesBetween(now, past).minutes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment