Getting the Current Date and Time


#1

im stuck on this section, what im doing wrong

Getting the Current Date and Time

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

print datetime.now()

The first line imports the datetime library so that we can use it.

The second line will print out the current date and time.

Instructions

  1. Create a variable called now and store the result of datetime.now() in it.
  2. Then, print the value of now.

?

Stuck? Get a hint!

Get live, fast support from Codecademy


Welcome to our forums! Please Introduce Yourself
#2

Check the example.

Read the instructions carefully. How does one create a variable? How does one assign a value to a variable?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.