OverflowError: mktime argument out of range ???

J

Jorgen Bodde

Hi List

I am working on an app to store guitar songs I am practicing, and for
the fun of it I want to store the date of songs when they were
originally made. So far so good..

However, my taste of music is "Rag Time Blues" and that os OLD, very
OLD music. So it happened I entered a song from the date " 28 dec
1928".

It appears time.mktime cannot handle these 'extremities' ? I get an
overflow error. is there by any chance a solution to this? I do know
modern languages support at least 1900 as date (and now that I come to
think of it, songs from J.S. Bach are excluded from entering as well)
...

This is what I try:
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
OverflowError: mktime argument out of range

The only solution I can think of is making a custom time class that
handles all years, dates and months, but that is plain silly. I want
to be able to use the long date formatting etc, and that would mean
rewriting that part as well.

Any help is appreciated!
- Jorgen
 
D

Diez B. Roggisch

Jorgen said:
Hi List

I am working on an app to store guitar songs I am practicing, and for
the fun of it I want to store the date of songs when they were
originally made. So far so good..

However, my taste of music is "Rag Time Blues" and that os OLD, very
OLD music. So it happened I entered a song from the date " 28 dec
1928".

It appears time.mktime cannot handle these 'extremities' ? I get an
overflow error. is there by any chance a solution to this? I do know
modern languages support at least 1900 as date (and now that I come to
think of it, songs from J.S. Bach are excluded from entering as well)
..

This is what I try:

Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
OverflowError: mktime argument out of range

The only solution I can think of is making a custom time class that
handles all years, dates and months, but that is plain silly. I want
to be able to use the long date formatting etc, and that would mean
rewriting that part as well.

import datetime
datetime.date(1928, 12, 28)

Diez
 
J

Jorgen Bodde

Ok thanks, I missed out on datetime where the methods I need are also present.

I'll be refactoring my data a bit, thanks again!
- Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top