[python-win32] How to get actual FILETIME from PyTime

Rob Marshall rob.marshall17 at gmail.com
Thu Jun 28 00:45:31 EDT 2018


Thank-you. I also figured out that if I want the "actual" FILETIME I can do:

>>> get_filetime = lambda i: ((i & 0xffffffff),(i - (i & 0xffffffff))>>32)
>>> get_filetime(131742277260000000)
(905689856L, 30673639L)
>>> low,high = get_filetime(131742277260000000)
>>> (high<<32)+low
131742277260000000L
On Wed, Jun 27, 2018 at 1:49 PM Tim Roberts <timr at probo.com> wrote:
>
> Rob Marshall wrote:
> > Is there a way to get the actual FILETIME value from a PyTime?
>
> PyTime isn't actually a type.  It's just a set of conversion routines
> that produce standard datetime values.  So, your question really is "how
> to convert a datetime to a Windows FILETIME"?  And here's a Python
> module that can do that:
>
>
> https://gist.github.com/Mostafa-Hamdy-Elgiar/9714475f1b3bc224ea063af81566d873
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> https://mail.python.org/mailman/listinfo/python-win32


More information about the python-win32 mailing list