1 Replies - 232 Views - Last Post: 24 October 2013 - 02:52 AM Rate Topic: -----

#1 Orochimaru  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 47
  • Joined: 26-December 12

How can I compare these two time variables?

Posted 23 October 2013 - 05:32 PM

How can I compare these two time variables pubdate and timz?
Pub_date is a value that is extracted from a database. I want to be able to compare pubdate with current time to check if pubdate is Less than or Equal to current time.

How can I work with this?


>>> pubdate = article.pub_date
>>> "pubdate"
datetime.datetime(2073, 12, 25, 0, 1, 2, tzinfo=<UTC>)
>>>
>>> timz = timezone.now()
>>> "timz"
datetime.datetime(2013, 10, 24, 0, 20, 19, 369605, tzinfo=<UTC>)
>>>




Is This A Good Question/Topic? 0
  • +

Replies To: How can I compare these two time variables?

#2 Orochimaru  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 47
  • Joined: 26-December 12

Re: How can I compare these two time variables?

Posted 24 October 2013 - 02:52 AM

I found the answer thank you Stack Overflow.
http://stackoverflow...1831453#1831453

[Solved]
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1