fromisoformat()

fromisoformat : Return date object by taking date string in YYYY-MM-DD format .

Today's date

We used strftime()
from datetime import date
dt =date.fromisoformat(date.today().strftime('%Y-%m-%d'))
print(dt)
Output
2019-09-17
By using date string
from datetime import date
dt =date.fromisoformat('2019-09-22')
print(dt)
Output is here
2019-09-22
All Date Objects

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer