您的位置:首页 > 其它

Getting the Current Date and Time

2013-04-03 20:08 369 查看
Getting the Current Date and Time

To retrieve the current date and time, we can use a function called
datetime.now()
to
get that information.
In a later course, you'll learn all aboutfunctions.
For now, just know that
datetime.now()
calls
on a piece of code that comes with Python that figures out the current date and time for us.
from datetime import datetime
now=datetime.now()
print now


INSTRUCTIONS

Create a variable called
now
and
store the result of
datetime.now()
in
it. We'll use this variable in the next exercise.

Go ahead and print the value of the variable
now
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: