Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFTPFileProperties component mtime

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

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
Manju
Labels (3)
2 Replies
talendtester
Creator III
Creator III

I think something like this:
TalendDate.parseDate("EEE MMM dd HH:mm:ss", DateVariableHere);
or
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:
DateFormat:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
Anonymous
Not applicable
Author

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?
thanks,
Manju