惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

博客园 - 范晨鹏

分省svg代码 noi数据分析工具 unreal engine 5 移动到其它主机时的 epic games launcher 识别修复 楼宇对讲自动开门的设计与实现 循*迹小车轨道识别算法 树莓派ssh卡顿之双机互联解决 安装 django 教程 利用 dns 实现 app简易抓包 安装django 框架 tensorflow 学习记记——环境安装 用pillow和 opencv做透明通道的两图混全(blend) centos升级gcc centos 7 中 tomcat 安装 centos中 mysql 5.7安装 xsocks 64位平台下编译问题小记 openwrt 编译newifi 应用程序 mingw 环境编译 liburl故障一例 szutsid youku.com awstats 日志分析工具linux下的安装和使用
ntfs 时间戳换算
范晨鹏 · 2021-06-14 · via 博客园 - 范晨鹏

ntfs记录的文件时间,在MFT的0x10属性中,存储的是8个byte的时间,这个时间表示的是自1601年1月1日的00:00开始的100ns的计数.

 

132,670,139,622,214,003(00) ns = 132,670,139,62 s

from dateutil.parser import parse
import time as tm
from datetime import *

var = 0x01D756CA007BC973
time_ntfs = parse('1601-01-01/00:00:00')
time_utc = parse('1970-01-01/00:00:00' )
varstr = var.to_bytes(8,'little',signed=False)
print ( 'HEX:\t%#2x'  %  var  )
print ( 'HEX(lit):\t%#2s'  % bytes.hex(varstr)  )
print (  'int:\t%d' % var  )
offset =  ((time_utc- time_ntfs)).total_seconds() * 10000000
var_file = (var - offset) 
print ( var_file )
print ( datetime.utcfromtimestamp(var_file /10000000 ) )

time_file = parse('2021-06-01/09:39:22.221400' )
print (tm.mktime(time_file.timetuple()))
HEX:	0x1d756ca007bc973
HEX(lit):	73c97b00ca56d701
int:	132670139622214003
1.6225403622214e+16
2021-06-01 09:39:22.221400
1622511562.0