@node _dos_setftime, dos @subheading Syntax @example #include unsigned int _dos_setftime(int handle, unsigned int date, unsigned time); @end example @subheading Description This function sets the date and time of the given file. The meaning of DOS date in the @var{date} variable is the following: @example F E D C B A 9 8 7 6 5 4 3 2 1 0 (bits) x x x x x x x x x x x x x x x x *-----------* *-----* *-------* year month day year = 0-119 (relative to 1980) month = 1-12 day = 1-31 @end example The meaning of DOS time in the @var{time} variable is the following: @example F E D C B A 9 8 7 6 5 4 3 2 1 0 (bits) x x x x x x x x x x x x x x x x *-------* *---------* *-------* hours minutes seconds hours = 0-23 minutes = 0-59 seconds = 0-29 in two-second intervals @end example @xref{_dos_getftime}. This function cannot be used to set the last access date and time, even on systems where the LFN API (@pxref{_use_lfn, LFN}) is available. For LFN-aware functions with similar functionality see @ref{utime}, which is Posix-standard, and see @ref{utimes}. @subheading Return Value Returns 0 if successful and return DOS error on error (and sets @var{errno}=EBADF). @subheading Portability @portability !ansi, !posix @subheading Example @example struct dosdate_t d; struct dostime_t t; unsigned int handle, date, time; _dos_open("FOO.DAT", O_RDWR, &handle); _dos_getdate(&d); _dos_gettime(&t); date = ((d.year - 1980) << 9) | (d.month << 5) | d.day; time = (t.hour << 11) | (t.minute << 5) | (t.second / 2); _dos_settime(handle, date, time); _dos_close(handle); @end example