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

strptime() makes an error concerning second in arg #47519

Closed
nevgor mannequin opened this issue Jul 3, 2008 · 5 comments
Closed

strptime() makes an error concerning second in arg #47519

nevgor mannequin opened this issue Jul 3, 2008 · 5 comments
Labels
build The build process and cross-build

Comments

@nevgor
Copy link
Mannequin

nevgor mannequin commented Jul 3, 2008

BPO 3269
Nosy @facundobatista
Files
  • unnamed
  • unnamed
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2008-07-03.13:49:20.970>
    created_at = <Date 2008-07-03.11:47:35.681>
    labels = ['build', 'invalid']
    title = 'strptime() makes an error concerning second in arg'
    updated_at = <Date 2008-07-03.14:03:56.547>
    user = 'https://bugs.python.org/nevgor'

    bugs.python.org fields:

    activity = <Date 2008-07-03.14:03:56.547>
    actor = 'nevgor'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-07-03.13:49:20.970>
    closer = 'facundobatista'
    components = ['None']
    creation = <Date 2008-07-03.11:47:35.681>
    creator = 'nevgor'
    dependencies = []
    files = ['10803', '10804']
    hgrepos = []
    issue_num = 3269
    keywords = []
    message_count = 5.0
    messages = ['69192', '69198', '69200', '69201', '69202']
    nosy_count = 2.0
    nosy_names = ['facundobatista', 'nevgor']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue3269'
    versions = ['Python 2.5']

    @nevgor
    Copy link
    Mannequin Author

    nevgor mannequin commented Jul 3, 2008

    strptime() allows 60 and 61 sec, but not 62 sec in arg. string

    >>> s='02/28/2000 12:33:61 AM'
    >>> time.strptime(s,'%m/%d/%Y %I:%M:%S %p')
    (2000, 2, 28, 0, 33, 61, 0, 59, -1)

    >> s='02/28/2000 12:33:62 AM'
    >> time.strptime(s,'%m/%d/%Y %I:%M:%S %p')

    Traceback (most recent call last):
      File "<pyshell#12>", line 1, in <module>
        time.strptime(s,'%m/%d/%Y %I:%M:%S %p')
      File "C:\Python25\lib\_strptime.py", line 330, in strptime
        (data_string, format))
    ValueError: time data did not match format:  data=02/28/2000 12:33:62 AM
     fmt=%m/%d/%Y %I:%M:%S %p

    @nevgor nevgor mannequin added the build The build process and cross-build label Jul 3, 2008
    @facundobatista
    Copy link
    Member

    Minutes with 61 (0..60) and 62 (0..61) seconds are used to adjust the
    theoretical calendar because of small differences with real world
    rotation...

    Are you aware of any case where a minute with 63 seconds (0..62) should
    be used?

    @nevgor
    Copy link
    Mannequin Author

    nevgor mannequin commented Jul 3, 2008

    Thank you for your reply, although is not helpful for me.

    I use strptime() for datedate transformation and datatime boundaries
    checking
    and therefore I am not conserned in Reltivity theory.

    When someone in datetime table enter 02:61:38 it is sign for me to
    rise a warning and not to supposed that the gay is astrophysicist :)

    -------------------------

    On Thu, Jul 3, 2008 at 3:19 PM, Facundo Batista <report@bugs.python.org>
    wrote:

    Facundo Batista <facundo@taniquetil.com.ar> added the comment:

    Minutes with 61 (0..60) and 62 (0..61) seconds are used to adjust the
    theoretical calendar because of small differences with real world
    rotation...

    Are you aware of any case where a minute with 63 seconds (0..62) should
    be used?

    ----------
    nosy: +facundobatista


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue3269\>


    @facundobatista
    Copy link
    Member

    Closing as invalid, two reasons:

    • Your original issue was that time.strptime() didn't allow 62 seconds,
      not that it allowed 60 or 61.

    • If you use it to validate input... how do you actually know that
      03/25/2012 17:13:61 AM' is an invalid date?

    I suggest to bring this issue in the python list if you have further doubts.

    Thank you!!

    @nevgor
    Copy link
    Mannequin Author

    nevgor mannequin commented Jul 3, 2008

    • My original issue was that time.strptime() makes difference between 61 and
      62 seconds
    • 17h AM, 78 s, 128min everyone can easly transform correctly, I just wanted
      to use function for
      boundarie checking: rising error for 62 sec and not for 61 is confusing!
    • I just wanted to point out that Python should be consistent: to provide
      the same behaviour for 60,61 and 62 sec.

    The conclusion is over as far as I am concerned.
    I got the picture (you standpoint), and I hope, you too.

    Thank you, once again,

    Regards

     Neven
    

    ----------------------

    On Thu, Jul 3, 2008 at 3:49 PM, Facundo Batista <report@bugs.python.org>
    wrote:

    Facundo Batista <facundo@taniquetil.com.ar> added the comment:

    Closing as invalid, two reasons:

    • Your original issue was that time.strptime() didn't allow 62 seconds,
      not that it allowed 60 or 61.

    • If you use it to validate input... how do you actually know that
      03/25/2012 17:13:61 AM' is an invalid date?

    I suggest to bring this issue in the python list if you have further
    doubts.

    Thank you!!

    ----------
    resolution: -> invalid
    status: open -> closed


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue3269\>


    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant