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

mktime out of range #26

Closed
haubourg opened this issue Apr 10, 2012 · 7 comments
Labels
bug

Comments

@haubourg
Copy link

@haubourg haubourg commented Apr 10, 2012

Hi again,
my dataset raises of range errors. You can find a shapefile here:
http://dl.dropbox.com/u/72368800/step.zip

please test it with "date_service" as start date and "date_hs" as end date. If "date_hs is null", it means that the feature is still in service.

here is the error raised at each frame:
File "C:/Documents and Settings/haubourg/.qgis/python/plugins\timemanager\timemanagerprojecthandler.py", line 34, in writeSetting
value = mktime(value.timetuple()) # convert datetime to float
OverflowError: mktime argument out of range

I have same errors with postgis data... Maybe date from 0194/01/01 to 2200/01/01 is to large for your float range?

We need only a frame each year so I put 52 weeks in "Time Frame Size"

All the best,
Régis

@anitagraser

This comment has been minimized.

Copy link
Owner

@anitagraser anitagraser commented Apr 10, 2012

Thanks for your report!

I've been looking into the mktime() issue before but couldn't find a suitable alternative. It's really limiting. But the datetime class is at the core of TimeManager ....

If you come across a better datetime method, please let me know. I'll keep looking too.

You can test with any python console which maximum range is supported by datetime on your system.

@haubourg

This comment has been minimized.

Copy link
Author

@haubourg haubourg commented Apr 11, 2012

Hi,
it seems that 1970 is the beginning of the epoch with a windows xp 32 bits OS... All dates before that are typo errors in my dataset, I can live without it. I keep looking at it..

@nirvn

This comment has been minimized.

Copy link

@nirvn nirvn commented Jan 4, 2013

Ouch, I'm also hitting this issue (visualizing US bombing of SEA from 1965 to 1975).

@anitagraser , have you had any luck figuring out a better function? I'm seeing here (http://stackoverflow.com/questions/2518706/python-mktime-overflow-error) that dates prior to 1970-01-01 aren't supported by mktime. That's a problem :)

@nirvn

This comment has been minimized.

Copy link

@nirvn nirvn commented Jan 14, 2013

For the record, in case others are facing this problem and looking for a workaround: look at your lowest date, and add to all dates the difference between lowest and 1970-01-01. I.e. if your date range starts 1965-01-01, inflate all of your dates of 5 years. It's cheap but it works, until underlying issue is fixed :)

@carolinux

This comment has been minimized.

Copy link
Collaborator

@carolinux carolinux commented Dec 19, 2014

Alright, will tackle the strftime and mktime issues. Strftime I get on my platform, but mktime works correctly. If somebody had the error on a Unix system please tell me the specs. I will try on my Windows machine later today.

@carolinux

This comment has been minimized.

Copy link
Collaborator

@carolinux carolinux commented Dec 28, 2014

BTW There it two issues here: The date 0194/01/01 being inappropriate for mktime to handle AND also the time range in seconds is too big and doesnt fit in an integer (so it cant fit in the slider). The first one is addressed in #77, the second issue needs even more rethinking of how the slider works. :)

@carolinux

This comment has been minimized.

Copy link
Collaborator

@carolinux carolinux commented Jan 12, 2015

This is fixed now.

@carolinux carolinux closed this Jan 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.