3

I am trying to get the date and time on python for a program I am writing, But I am unsure how to get them. I tried to do it like the following:

import datetime
import date

This usually works but now it just prints:

<module 'time' (built-in)> <module 'datetime' from 'C:\\Python34\\lib\\datetime.py'>

How can I fix this?

Umutambyi Gad
  • 4,082
  • 3
  • 18
  • 39
Joe
  • 141
  • 5

1 Answers1

1

Formatted time: datetime.datetime.now().strftime('%d/%m/%Y %H:%M')

Datetime object: datetime.datetime.now()

rofls
  • 4,993
  • 3
  • 27
  • 37