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

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

@omr456

Description

@omr456

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions