Skip to content

Commit

Permalink
Update the Android fileLastModified method to return values in seco…
Browse files Browse the repository at this point in the history
…nds instead of milliseconds
  • Loading branch information
m4gr3d committed Aug 15, 2024
1 parent ee363af commit cde873b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal class FileData(filePath: String, accessFlag: FileAccessFlags) : DataAcc

fun fileLastModified(filepath: String): Long {
return try {
File(filepath).lastModified()
File(filepath).lastModified() / 1000L
} catch (e: SecurityException) {
0L
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ internal class MediaStoreData(context: Context, filePath: String, accessFlag: Fi
}

val dataItem = result[0]
return dataItem.dateModified.toLong()
return dataItem.dateModified.toLong() / 1000L
}

fun rename(context: Context, from: String, to: String): Boolean {
Expand Down

0 comments on commit cde873b

Please sign in to comment.