Skip to content

Timezones #4

@dbrgn

Description

@dbrgn

Gnucash exported the transactions using UTC time, while the Gnucash software is set to UTC+2.

Therefore transactions that occured on "2016/08/02" were exported as "2016/08/01 22:00" and interpreted as "2016/08/01".

I used this hack in gnucash.py to adjust:

import calendar

# ...

    def parse_time(time):
        dt = datetime.strptime(time, "%Y%m%d%H%M%S")                                                
        timestamp = calendar.timegm(dt.timetuple()) + 7200                                                               
        return datetime.utcfromtimestamp(timestamp)         

Maybe this could be made configurable using a CLI switch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions