Groovy web console

subscribe to the feed Subscribe
to this
site
groovy (via #groovywebconsole)
tweet this snippet Tweet
this
script

groovy

Published 1 week ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import java.text.SimpleDateFormat
import groovy.time.TimeCategory
SimpleDateFormat parser = new SimpleDateFormat('dd/MM/yyyy')
def date1 = parser.parse(new Date().format('dd/MM/yyyy'))

def date2 = parser.parse('01/01/1900')
def excelDate = TimeCategory.minus(date1,date2).days+2

println new Date();
println excelDate;