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
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
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
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
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