Skip to content

Timestamp Calculation doesn't work in Windows #283

@squintsgeek

Description

@squintsgeek

In lines 2061 and 2077 in data_management.py, the %s format code is platform-dependent on *nix-like OSes, and the _validate_sql_recovery_point() method (and any dependencies that rely on this method) will abend in Windows with a "invalid string format" error:

recovery_timestamp = int(recovery_date_time.strftime('%s')) * 1000

However, this line is platform-independent, and will work with any Python version:

recovery_timestamp = (recovery_date_time-datetime(1970,1,1,0,0,0)).total_seconds() * 1000

I’ve tested the replacement in a v3.7 venv on my Windows machine, and it appears to fix the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions