Re: Unconverted data remains

Discussion in 'Python' started by MRAB, Nov 8, 2012.

  1. MRAB

    MRAB Guest

    On 2012-11-08 08:04, Nikhil Verma wrote:
    > Hi
    >
    > My Problem
    >
    >
    > I have a list :-
    > L = ['Sunday November 11 2012 9:00pm ', 'Thursday November 15 2012
    > 7:00pm ',\
    > 'Friday November 16 2012 7:00pm ', 'Monday November
    > 19 2012 7:30pm ', \
    > 'Friday November 23 2012 7:30pm ', 'Sunday November
    > 25 2012 8:00pm ',\
    > 'Monday November 262012 7:00pm ', 'Thursday November
    > 29 2012 6:30pm ',\
    > 'Saturday December 1 20125:30pm ', 'Thursday December
    > 6 2012 9:00pm ',\
    > 'Sunday December 9 2012 7:00pm ', 'Friday November 9
    > 2012 6:00pm ', \
    > 'Friday November 9 2012 7:00pm ', 'Friday November 9
    > 2012 7:00pm ']
    >
    > final_event_time = [datetime.strptime(iterable, '%A %B %d %Y %I:%M%p')
    > for iterable in L]
    >
    > and having this error Unconverted data remains . I am trying to convert
    > all these in datetime object.
    >

    It's complaining about the trailing space in the strings. Try removing
    it.
    MRAB, Nov 8, 2012
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vMike
    Replies:
    1
    Views:
    480
    Natty Gur
    Aug 26, 2003
  2. vMike
    Replies:
    1
    Views:
    351
    Natty Gur
    Aug 26, 2003
  3. Chris
    Replies:
    1
    Views:
    309
    bruce barker
    Apr 12, 2004
  4. \Rob\
    Replies:
    0
    Views:
    423
    \Rob\
    May 10, 2004
  5. Peter Otten

    Re: Unconverted data remains

    Peter Otten, Nov 8, 2012, in forum: Python
    Replies:
    0
    Views:
    200
    Peter Otten
    Nov 8, 2012
Loading...

Share This Page