Each of these functions returns 0 if the file-modification time was changed. A return value of –1 indicates an error. If an invalid parameter is passed, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions return -1 and errno is set to one of the following values:
- EACCES
Path specifies directory or read-only file
- EINVAL
Invalid times argument
- EMFILE
Too many open files (the file must be opened to change its modification time)
- ENOENT
Path or filename not found
See _doserrno, errno, _sys_errlist, and _sys_nerr for more information on these, and other, return codes.
The date can be changed for a file if the change date is after midnight, January 1, 1970, and before the end date of the function used. In Visual C++ 2005, _utime and _wutime now use a 64-bit time value, so the end date is 23:59:59, December 31, 3000, UTC. If _USE_32BIT_TIME_T is defined to force the old behavior, the end date is 03:14:07 January 19, 2038, UTC. _utime32 or _wutime32 use a 32-bit time type regardless of whether _USE_32BIT_TIME_T is defined, and always have the earlier end date. _utime64 or _wutime64 always use the 64-bit time type, so these functions always support the later end date.