Assume your machine is Linux the you have following option -
$ touch -t [[CC]YY]MMDDhhmm[.SS]
CC – Specifies the first two digits of the year
YY – Specifies the last two digits of the year.
MM – Specifies the month
DD – Specifies the date
hh – Specifies the hour
mm – Specifies the minute
SS – Specifies the seconds
For example:
$ touch -a -m -t **********.09 <yourfile>
So you can call the above command from the system statement in the C.
Now coming to the windows, in Windows you have following two API for the same purpose -
GetFileTime
SetFileTime
Let me know if you still have some issue.