File.LastModified Method

Definition

Returns the time that the file denoted by this abstract pathname was last modified.

[Android.Runtime.Register("lastModified", "()J", "GetLastModifiedHandler")]
public virtual long LastModified ();
[<Android.Runtime.Register("lastModified", "()J", "GetLastModifiedHandler")>]
abstract member LastModified : unit -> int64
override this.LastModified : unit -> int64

Returns

A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist or if an I/O error occurs

Attributes

Remarks

Returns the time that the file denoted by this abstract pathname was last modified.

Where it is required to distinguish an I/O exception from the case where 0L is returned, or where several attributes of the same file are required at the same time, or where the time of last access or the creation time are required, then the java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) Files.readAttributes method may be used.

Java documentation for java.io.File.lastModified().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to