Just to add the why to this discussion:
In many (most?) cases, using the OS timestamp for the content file as
lastmod would be misleading. I just did a quick check on my site, and even files I haven't touched in many years are marked as changed last August (the date I did a clone of the repo to my computer?)
I have had some ideas about using the Git revisions to get a more real timestamp (for those who use Git), but I haven't found a performant way to do it, yet.