Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Fix for problem in store.py, Please examine #8

Open
omr456 opened this issue Jan 10, 2011 · 1 comment
Open

Fix for problem in store.py, Please examine #8

omr456 opened this issue Jan 10, 2011 · 1 comment

Comments

@omr456
Copy link

omr456 commented Jan 10, 2011

When using python I've got the following problem

/opt/omron/usr/local/python/omron/store.py", line 7, in ymdhms2seconds
t = time.strptime("%d %d %d %d %d %d"%(YY,MM,DD,hh,mm,ss),format)
File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '9 1 14 11 21 59' does not match format '%y %m %d %H %M %S'

line 6 and 7 in store.py are
6 format = "%y %m %d %H %M %S"

I fixed it by adding 02 for each %d so line 7 became

7 t = time.strptime("%02d %02d %02d %02d %02d %02d"%(YY,MM,DD,hh,mm,ss),format)

so instead year 9 its 09 and month 1 its 01, looks like %y and %m specs always requres 2 digits and not one

@omr456
Copy link
Author

omr456 commented Jan 10, 2011

line 7 before fix was
7 t = time.strptime("%d %d %d %d %d %d"%(YY,MM,DD,hh,mm,ss),format)

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