Re: How can I know if a date is prior to today?

2009-03-25 Thread John Machin
On Mar 26, 12:51 am, Tim Chase wrote: > > I have a date expressed in seconds. > > I'd want to pretty print it as "%H:%M" if the time refers to today and > > "%b%d" (month, day) if it's of yesterday or before. > > > I managed to do that with the code below but I don't like it too much. > > Is there

Re: How can I know if a date is prior to today?

2009-03-25 Thread Giampaolo Rodola'
On 25 Mar, 14:51, Tim Chase wrote: > > I have a date expressed in seconds. > > I'd want to pretty print it as "%H:%M" if the time refers to today and > > "%b%d" (month, day) if it's of yesterday or before. > > > I managed to do that with the code below but I don't like it too much. > > Is there a

Re: How can I know if a date is prior to today?

2009-03-25 Thread Tim Chase
I have a date expressed in seconds. I'd want to pretty print it as "%H:%M" if the time refers to today and "%b%d" (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too much. Is there a better way to do that? Thanks in advance. import time

Re: How can I know if a date is prior to today?

2009-03-25 Thread Paul McGuire
On Mar 25, 8:31 am, "Giampaolo Rodola'" wrote: > Hi, > I have a date expressed in seconds. > I'd want to pretty print it as "%H:%M" if the time refers to today and > "%b%d" (month, day) if it's of yesterday or before. > Use datetime module. import time from datetime import datetime now = time.ti

How can I know if a date is prior to today?

2009-03-25 Thread Giampaolo Rodola'
Hi, I have a date expressed in seconds. I'd want to pretty print it as "%H:%M" if the time refers to today and "%b%d" (month, day) if it's of yesterday or before. I managed to do that with the code below but I don't like it too much. Is there a better way to do that? Thanks in advance. import ti