Android Question File Versions

peggjones

Active Member
Licensed User
Longtime User
Anyone got any ideas on the following?

I have two copies of a file and want to work out which one is the most recent.

I tried using file.lastmodified but this returns only the date not the time.

Many thanks.
 
According to the android developer docs, the last modified time should be available. See here which states that the time will be returned measured in milliseconds since the 1st January 1970.
I've also checked using ES File Explorer and that is able to display the modified time.
Maybe you need to use a Java Object or the Reflection library to access it? But before doing that have you tried using...
Code: Copy
DateTime.Time(File.LastModified(File.DirRootExternal, "yourFile.txt"))

Kind regards,
RandomCoder
 
Upvote 0
Back
Top