One Star

tFTPFileProperties component mtime

Hi All,
the tFTPFileProperties component's mtime property gives only time. Is there a way to get both date & time?

System.out.print("Date "+new Date(input_row.mtime)+" ");
result will be as below
Date Thu Jan 15 20:34:34 IST 1970
Here it takes default java's start date i.e 1970.

Thanks in advance
Nine Stars

Re: tFTPFileProperties component mtime

I think something like this:
TalendDate.parseDate("EEE MMM dd HH:mm:ss", DateVariableHere);
TalendDate.parseDate("EEE MMM dd HH:mm:ss","Jan 15 20:34:34");
I don't know how to get the year like you want. This website link may help:
One Star

Re: tFTPFileProperties component mtime

mtime property has date value in milliseconds. When we use that value to get date, like Date dt = new Date(mtime);
We get both date & time, but the date will be default start date i.e. 1970.
the reason for this is mtime property has only time value in milliseconds.
my question is there a way to get both modifed date & time for a file?