Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Timestamp Out of Range Exception #2

Open
ye opened this issue Mar 29, 2013 · 0 comments
Open

Timestamp Out of Range Exception #2

ye opened this issue Mar 29, 2013 · 0 comments

Comments

@ye
Copy link

ye commented Mar 29, 2013

The timestamp that's stored in Trac 0.12.2 is in microseconds not seconds. So it's necessary to convert it into seconds by dividing 100000.

$ ./trac2pivotal.py trac.db pline-tractickets.csv
Reading "trac.db", writing "pline-tractickets-*.csv".
Converting 2182 tickets...
Writing tickets to pline-tractickets-1.csv ...
time =====>  1304016817559988
Traceback (most recent call last):
  File "./trac2pivotal.py", line 296, in <module>
    main()
  File "./trac2pivotal.py", line 291, in main
    write_csv(source, target)
  File "./trac2pivotal.py", line 244, in write_csv
    for entry in source:
  File "./trac2pivotal.py", line 221, in read_database
    result["Created at"] = translate_time(ticket[2])
  File "./trac2pivotal.py", line 139, in translate_time
    date = datetime.fromtimestamp(time)
ValueError: year is out of range

Screen Shot 2013-03-28 at 8 04 32 PM
Will send a pull request for the fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant