New submission from sw:

The explanation of the 3rd index of the tuple returned from 
_winreg.QueryInfoKey(key) explains that it is a long representing 100s of 
nanoseconds since 1/1/1600.

However, when I use this value and convert to the actual date using 
startDate = datetime(1600,1,1)
lastModified = QueryInfoKey(key)[2]
print "%s" % startDate + timedelta(seconds=lastModified*(10**-9)*100) 

The date is about right except for the year value, it's off by one.

I suspect the documentation should say the value in the tuple is the time since 
1/1/1601 instead of 1/1/1600. This would corroborate Microsoft's documentation 
that makes references to 1/1/1601 (i.e. 
http://technet.microsoft.com/en-ca/aa393040(v=vs.90).aspx)

----------
messages: 225125
nosy: slw07g
priority: normal
severity: normal
status: open
title: _winreg.QueryInfoKey Last Modified Time Value Incorrect or Explanation 
Incorrect
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22178>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to