OK, I read your explanation. I don't understand the need....So I'm a bit curious if nothing else. Why do you think you need to diddle with the time on the file?
There are plenty of examples of a need to modify file date/times. Here are a few of mine:
My first need for Pearson’s file-date/time functions was a project for which the organization needed a system to suck data out of a massive pile of complex Word-document forms and organize it in corresponding Excel workbooks, for analysis and reporting by relatively non-technical users. Part of the requirement was that the users needed to be able to sort the resulting Excel files, in File Explorer, by content type (file name) and by analysis-workbook date (Created date) but also by the date of a
content field in the original Word doc form. So I used Pearson’s SetFileDateTime function to set the resulting Excel file’s Last-Modified date to the form-content date value, and set the file’s Read-only attribute in order to prevent subsequent modifications to it. Then the user could sort by topic (file name), report-file Created date, or form-content date (report-file Modified date) as needed. It was a crude but easy-to-use, simple reporting system that got a lot of mileage. That design did have the odd effect of the files having Modified dates older than their Created dates, but everyone understood the context and functionality, so it wasn’t a problem.
Eventually, I realized I could use Pearson’s functions to work around an annoying “feature” in the Windows file system: unlike files, when a folder is copied to a different drive (for backup/archive purposes), Windows sets the folder’s Last-Modified date and Last-Accessed date to be the same as the its Created date, instead of copying the original folder’s dates. One of my programmer’s survival tools has been to regularly make archival backup copies of the source-files for whatever system I’m developing, in case regression testing reveals yet another bone-headed, naive design choice, and I have to back up, possibly several steps, and take a different tack on the solution. But I need to organize the archive folders (and their contained files) by the last-modified date of the
original folder (or file). So I modified Pearson’s functions to work with folders, in addition to files, and built a little tool that allows me to fix that annoying folder-date “feature” of Windows.
And then I realized I could upgrade that tool to work around a design-flaw in the programmer himself: he's a fallible human being. One of the ways that manifests is that, when digging deep into my archived designs, to determine where I went wrong or to just get ideas about how to maybe adapt those designs to new purposes, I sometimes get distracted by the urgencies of life, or am just tired late in the day, and lose track of which file I have open in which Window and then accidentally re-save an old archive file and thereby set its last-modified date/time to the present time, screwing up my sort-by-date/time organization of those files. The current version of my tool allows me to reset such file's modified date back to what it was originally. For that use-case, accurate time stamp (not just date) became critical so I needed to further upgrade Pearson’s design to properly handle daylight-savings time. Hence the above utilities.