Program[01]-The datetime Library

来源:互联网 发布:ubuntu软件中心打不开 编辑:程序博客网 时间:2024/06/07 06:28

1.Getting the Current Date and Time

We can use a function called datetime.now() to retrieve the current date and time.

from datetime import datetimenow = datetime.now()print '%s/%s/%s %s:%s:%s' % (now.year, now.month, now.day, now.hour, now.minute, now.second)
>>>2017/9/30 13:16:54
阅读全文
0 0
原创粉丝点击