Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct parsing C# datetime #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pt4_bitreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# along with pt4utils. If not, see <http://www.gnu.org/licenses/>.
#

from datetime import datetime
import datetime
from bitreader import BitReader

class Pt4BitReader(BitReader):
Expand All @@ -33,12 +33,12 @@ class Pt4BitReader(BitReader):
def readDateTime(self):
""" Read and return date in epoch format
"""
epochShiftValue = 62135596800000L
val = self.readUInt64()
kind = val >> 62
ticks = val & 0x3FFFFFFFFFFFFFFFL
#return datetime.fromtimestamp((ticks / 10000) - epochShiftValue)
return 0
s = ticks / 10.0 ** 7
delta = datetime.timedelta(seconds=s)
dt = datetime.datetime(1,1,1) + delta
return dt


if __name__ == "__main__":
Expand Down