How to convert the date object 2010-11-10 14:52:35.026000 to integer?

Discussion in 'Python' started by Zeynel, Nov 10, 2010.

  1. Zeynel

    Zeynel Guest

    mDATE = "2010-11-10 14:52:35.026000"

    (Not sure if this is string or something else.)

    I would like to convert mDATE to integer to add, multiply etc.

    For instance, if I try to convert mDATE to seconds

    td = mDATE.seconds

    I get the error

    td = result.mDATE.seconds
    AttributeError: 'datetime.datetime' object has no attribute 'seconds'


    Thanks.
    Zeynel, Nov 10, 2010
    #1
    1. Advertising

  2. Zeynel

    rantingrick Guest

    On Nov 10, 9:40 am, Zeynel <> wrote:
    > mDATE = "2010-11-10 14:52:35.026000"
    >
    > (Not sure if this is string or something else.)
    >
    > I would like to convert mDATE to integer to add, multiply etc.
    >
    > For instance, if I try to convert mDATE to seconds
    >
    > td = mDATE.seconds
    >
    > I get the error
    >
    >     td = result.mDATE.seconds
    > AttributeError: 'datetime.datetime' object has no attribute 'seconds'
    >
    > Thanks.


    No group likes when you ask the same question twice in two different
    threads. faus pas! Go back and check your other thread for
    enlightenment.
    rantingrick, Nov 10, 2010
    #2
    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.

Share This Page