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

推荐订阅源

J
Java Code Geeks
腾讯CDC
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
L
LangChain Blog
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
P
Proofpoint News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
IT之家
IT之家
A
About on SuperTechFans
H
Help Net Security

博客园 - 范晨鹏

分省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