Forum Discussion
5 years ago
wait, nevermind! I figured it out! I can use the Date() and getTime() functions to convert the dates into seconds since 1970, and then I can compare times via a common denominator....seconds!
def date=new Date().format('yyyyMMddHH')
Date filedate = new Date("2020/11/03, 02:02:01");
println "Hello World todates date is: " + date
println "file date is: " + filedate
println "the FileDate in seconds is: "+ filedate.getTime();
---GROOVY---
returns null
output:
Hello World todates date is: 2020110311
file date is: Tue Nov 03 02:02:01 EST 2020
the FileDate in seconds is: 1604386921000
Related Content
- 2 years ago
- 3 months ago