Hey,
I'm trying to get the last created file in a folder using the Java SDK.
I iterate over each file in that folder and then use the getCreatedAt() method to compare which is the last file. It seems that the value I get from the method is wrong. Or I'm not using the right method.
Here is a simplified snippet of my code.
// here I just connect to my Box
BoxDeveloperEditionAPIConnection api = connectToTheBox();
BoxFolder folder = new BoxFolder(api, "***number removed for privacy***");
System.out.println("Iterating over the folder: " + folder.getInfo().getName());
for (BoxItem.Info itemInfo : folder) {
if (itemInfo instanceof BoxFile.Info) {
BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
System.out.println(" File: " + fileInfo.getName());
DateTime curCreatedAt = new DateTime(fileInfo.getCreatedAt());
DateTimeFormatter dateTimeFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
System.out.println(" created_at: " + dateTimeFormat.print(curCreatedAt));
}
}Output is the following:
Iterating over the folder: CallData
File: BI Report KW 49.xlsx
created_at: 2017-12-07 17:31:25
File: BI Report.xlsx
created_at: 2017-12-07 17:31:25Here is a screenshot from the Box and my Java Console where I highlighted the points.

Is there another (correct) way to get the created at value from the file info, or is this a bug?
Cheers,
Felix