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: 
SMurphy1703184287
Contributor II
Contributor II

Need Created Date of File; Not Modified (mtime)

I have a current job that grabs images from a folder and uploads them if their Modified date time is AFTER the last upload date.  Problem is... I have images with dates like this...

Created Date: June 11, 2024

Modified Date: May 20, 2024

How is the Created Date AFTER the Modified Date?  Because of this - these images are not being caught.  I think the June 11th date is when the images are being copied into my shared folder; but May 20th is when the graphic was actually created and edited?

I know tFileProperties will give me mtime - is there a "ctime" that tells me the created date/time?

Labels (3)
1 Solution

Accepted Solutions
Shicong_Hong
Support
Support

@SMurphy1703184287 Created Date: the date when the file is created or moved to a new folder.  tFileProperties only returns the modified date, you can use this piece of Java code on tJava to get the created date. 

Path file = Paths.get("D:/shong/out.txt");
BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class);

System.out.println("creationTime: " + attr.creationTime());

tJava's Advanced Settings tab:

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;

2024-07-03_16-44-06.png

Regards

Shicong

View solution in original post

2 Replies
Shicong_Hong
Support
Support

@SMurphy1703184287 Created Date: the date when the file is created or moved to a new folder.  tFileProperties only returns the modified date, you can use this piece of Java code on tJava to get the created date. 

Path file = Paths.get("D:/shong/out.txt");
BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class);

System.out.println("creationTime: " + attr.creationTime());

tJava's Advanced Settings tab:

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;

2024-07-03_16-44-06.png

Regards

Shicong

SMurphy1703184287
Contributor II
Contributor II
Author

Thank you!  I haven't had time to try this out - but I think this is what I'm looking for!