Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Ashok200792
Contributor
Contributor

How to get the date and time of file create in the Folder ??

How to get the date and time of file create in the Folder and compare to current date and time , to validation max of 6 hours of file is created or not like that we need to check.

Labels (2)
1 Solution

Accepted Solutions
TRF
Creator III
Creator III

Hi,

If I understand, you want to do some action for files created our modified for 6 hours or more.

tFileProperties give you many properties for a file, included number of milliseconds elapsed between EPOC (1970-01-01) and last modified date.

Here is an example:

0683p000009LrwE.png

tFlowToIterate generates a global variable for each property, so you can access those variables from anywhere after this component.

For example, you can test the value before to go to the next step.

In this example, tJava_3 represents this "next step", and the condition expressed in the "Run if" trigger is the following:

(TalendDate.getCurrentDate().getTime())-((Long)globalMap.get("row31.mtime")) > 6*3600*1000

So, the next step is executed only for files with "mtime" older than 6 hours (expressed in milliseconds).

Hope this helps.

 

View solution in original post

5 Replies
TRF
Creator III
Creator III

Hi,
Check for tFileProperties.
Ashok200792
Contributor
Contributor
Author

How to Use the date and Time ,

For example : One path location File its before Six hours (6 hrs) moved to create that date and time , we need to check that file date and time & we compared to current date and time , and do some-action if that file more that Six hours (6 hrs) is same location means.
TRF
Creator III
Creator III

Hi,

If I understand, you want to do some action for files created our modified for 6 hours or more.

tFileProperties give you many properties for a file, included number of milliseconds elapsed between EPOC (1970-01-01) and last modified date.

Here is an example:

0683p000009LrwE.png

tFlowToIterate generates a global variable for each property, so you can access those variables from anywhere after this component.

For example, you can test the value before to go to the next step.

In this example, tJava_3 represents this "next step", and the condition expressed in the "Run if" trigger is the following:

(TalendDate.getCurrentDate().getTime())-((Long)globalMap.get("row31.mtime")) > 6*3600*1000

So, the next step is executed only for files with "mtime" older than 6 hours (expressed in milliseconds).

Hope this helps.

 

Ashok200792
Contributor
Contributor
Author

Thanks a lots , its working fine .

Ashok
Ba09
Contributor
Contributor

Hello,

But what is the value of file name input in tFTPFilePropreties component!!

I have the same problem but i don't know what is a dynamic value which i can set in this input!!

0695b00000RhqjqAAB.png