Are Windows file timestamps timezone aware?
Are Windows file timestamps timezone aware?
回答
The time zone is an artefact of conversion from "instants" to a human-readable date-and-time in some calendar.
Computers do not like human-readable formats (not as much as humans, at least), so they usually store instants in a zone-neutral format. For instance, in the NTFS file system, time stamps are stored in UTC.
Hence, the file time modification is stored properly as long as whoever modifies it knows the current time. If your Windows system displays "13:19" and believes to be in the GMT-5 time zone, then it infers that the current instant is "18:19" in UTC, and writes as much in the NTFS entrails. However, if the OS displays "13:19" but believes to be in the GMT+3 time zone, then the OS is off by eight hours, even if, for the human looking at the screen, things seem fine.
Another point is that the file modification time is a property of the storage system in which the file is stored, e.g. a file system. When a file is "sent", then that time does not necessarily travels with it. Some archive formats (e.g. Zip) embed the file modification time along with the file. This does not apply to a file sent "as is", attached to an email, will not come with a file modification time.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2020-07-03 NLog rolling file
2020-07-03 Custom date and time format strings
2020-07-03 NLog layout map to conversionPattern with log4net
2019-07-03 Javascript 面向对象编程(一):封装
2019-07-03 Javascript继承机制的设计思想
2019-07-03 __proto__ VS. prototype in JavaScript
2019-07-03 ClientScriptManager.RegisterClientScriptBlock Method 无效