How to get Last modified date from tfileProperties

One Star

How to get Last modified date from tfileProperties

Hello, I want to extract file's last modified date and month. I am using tFileProperties (mtime_string) column but what I get is the date and time of file's last reference(i.e. when my job refers to tFileList and the file ultimately therein.) I am not modifying the file in anyway from my job.
What I expect is ---- If the file is zipped on say 3rd May 2016 and my job is running on 5th May 2016 then I want last modified date of the file as 3rd May 2016. Plz note the file is zipped file. How can I achieve this ? I also tried using Java code as below but it gives the same result i.e date and time job is running :
// assuming the correct filepath is given 
Long lastModified = file.lastModified();
Date date = new Date(lastModified);
Highlighted
Moderator

Re: How to get Last modified date from tfileProperties

Hi,
Could you please take a look at a related forum:https://www.talendforge.org/forum/viewtopic.php?id=44049 to see if it works well for your use case?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download