Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm trying to compare the last modified date of a file with todays date. I am expecting the output to be -1 because the documentation states "...-1 if the first date is earlier..."
Jan 18 at 06:46:30 is earlier than Jan 18 00:00:00...so why does the compareDate output a 1 instead of a -1? Is there something I am missing?
Any feedback is much appreciated!
Doc:
https://help.talend.com/r/DDjlr2GHaTAASHk4QPrCDw/drLRG4tDnucYg6H2Au0myQ
Hi jwing!
You have 2 dates: Jan 18 06:46:30 and Jan 18 00:00:00
Those are times of the same day: the first date is 6 hours after the second, that's why compareDate output is 1 (correct).
Maybe you wish to test if file_date is by midnight (before January 19)? If so, you could set today_date + 1day to go at 00:00 of the next day, in this way you're covered until 11.59.59 of January 18.
Hi Fabio,
Sorry for the late reply, was very busy of of late. Appreciate the response! I tried another scenario and wanted to see the output if I revise the file date but kept the today_date the same. Both are outputting -1 when the file data is before and after today_date. Do you know why the 2nd screenshot below doesn't show 1 ?