how can i get system time?

Mike Meyer mwm at mired.org
Fri Nov 11 02:44:45 EST 2005


"zelzel.zsu at gmail.com" <zelzel.zsu at gmail.com> writes:
> Hi, Can I get a system date time?

time.time()

> I want to get current time, like
> the target string should looks like:
>       the output of :  `date +"%Y%m%d %H:%M:%S"`
>
> how can i do this?

>>> time.strftime("%Y%m%d %H:%M:%S")
'20051111 02:44:19'
>>> 

    <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list