The function time is not being recognised in my python script

26 Views Asked by At

The time tags are not being identified and the "time" function is not being recognised or called. The requirement is to output the current date and time

import time
now= time.strftime(%b %d, %Y %H:%M:%S)
print("It is", now)

This is the code I tired, but unfortunately, I am getting an error.

now= time.strftime(%b %d, %Y %H:%M:%S)
                       ^
SyntaxError: invalid syntax

Above is the error I am getting

0

There are 0 best solutions below