If you convert timea into a normal datetime instance just substract
timea from timeb and you will get a datetime.timedelta instance which
has everything you need :-)

    import datetime
    a = datetime.datetime(2008, 11, 15)
    b = datetime.datetime.now()

    print b-a

-- Horst

On Fri, Nov 28, 2008 at 7:24 PM, Bobby Roberts <[EMAIL PROTECTED]> wrote:
> I need to know the # of seconds between two dates for my django
> application.  I believe this has to be done with straight python.
> I've read the py docs on time functions but it doesn't make sense to
> me.  Can anyone help? Here's my situation:
>
> timea='11/15/2008 11:35 AM'
>
> timeb=datetime.now()
>
> How can I calculate the diff between timeb and timea in seconds?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to