I
I
Irina2018-08-03 12:38:13
Python
Irina, 2018-08-03 12:38:13

Python: Why is the time output in the wrong format?

I want to get the time in the output in a readable format. There is such a function:

def time_now():
    from datetime import datetime
    return (datetime.datetime.now())
print(time_now)

And the result of her work is this: Tell me, what am I doing wrong?
<function time_now at 0x036AAA98>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KhD, 2018-08-03
@vera_ira

You forgot the parentheses when calling the function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question