Change the time at which the file or directory was last modified.
The operation may fail with:
isPermissionError if the user is not permitted to alter the modification time; or
isDoesNotExistError if the file or directory does not exist.
InvalidArgument on FAT32 file system if the time is before DOS Epoch (1 January 1980).
Some caveats for POSIX systems:
Not all systems support
utimensat, in which case the function can only emulate the behavior by reading the access time and then setting both the access and modification times together. On systems whereutimensatis supported, the modification time is set atomically with nanosecond precision.If compiled against a version of
unixprior to2.7.0.0, the function would not be able to set timestamps with sub-second resolution. In this case, there would also be loss of precision in the access time.