Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created June 1, 2016 14:29
Show Gist options
  • Save bdkosher/4107e8f499e2d3e1d2adab0c25c77508 to your computer and use it in GitHub Desktop.
Save bdkosher/4107e8f499e2d3e1d2adab0c25c77508 to your computer and use it in GitHub Desktop.
For those curious to know when Robert Trujillo's stint with Metallica will (or did) surpass Jason Newsted's.
def today = new Date()
def date(str) { Date.parse('yyyyMMdd', str) }
def newstedStint = date('20010117') - date('19861108')
def trujilloStint = today - date('20030224')
def diff = newstedStint - trujilloStint
// FIXME: "1 days" --> "1 day"
println "Trujillo's stint ${diff < 0 ? 'surpassed Newsted\'s ' + Math.abs(diff) + ' days ago' : 'will surpass Newsted\'s in ' + diff + ' days'} on ${(today + diff).format('MMM d, yyyy')}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment