produce the same output as Unix's date command

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Apr 5 18:36:02 EDT 2012



-------- Original Message --------
Subject: Re: produce the same output as Unix's date command
Date: Thu, 05 Apr 2012 22:07:42 +0100
From: Mark Lawrence <breamoreboy at yahoo.co.uk>
Newsgroups: gmane.comp.python.general
References: 
<CAOuJsMm5VjWzf9A9mKJUz1ZhPFf57DPzZAoP8ribg9qrB4nF4A at mail.gmail.com>

On 05/04/2012 21:52, Jabba Laci wrote:
> Hi,
>
> Unix's date command produces this output (example):
>
> Thu Apr  5 22:49:42 CEST 2012
>
> I would like to produce the same output with Python, without calling
> "date" externally. Before doing it I'd like to ask the list if anyone
> has an existing solution for this.
>
> Thanks,
>
> Laszlo

See
http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior.

-- 
Cheers.

Mark Lawrence.




More information about the Python-list mailing list