0

I have a datetime object

v = 21.01.2019 14:25:37

I want to convert above datetime object to date as this

a = convert(v)
a = 21.01.2019 

how i can do it

  • 1
    Does this answer your question? [How do I convert datetime to date (in Python)?](https://stackoverflow.com/questions/3743222/how-do-i-convert-datetime-to-date-in-python) – ldz Dec 08 '19 at 13:01

1 Answers1

2

If you want today's date.try this :

datetime.datetime.now().date()

If you want your datetime object date :

v.date()
Negar37
  • 402
  • 1
  • 8