toordinal : Return Proleptic Gregorian ordinal of the date starting with 1 as January 1 of year 1.

How ordinal is used to get date by using fromordinal()

Today's ordinal vlaue

from  datetime import date
print("Today toordinal value : ",my_ordinal)
Today toordinal value :  737319
Getting todays and tomorrows toordinal. We used timedelta here to get tomorrow's date object.
from datetime import date,datetime, timedelta 
print("Today toordinal : ", + timedelta(days=1)
print("Tomorrow toordinal : ",tomorrow.toordinal())
Output is here
Today toordinal :  737319
Tomorrow toordinal :  737320
We can create a date object and then get the value
import datetime
dt=datetime.datetime(2019,5,24) # Year , Month , date as input
We can check the above data ( todays date )
dt=datetime.datetime(2019,9,16) # Year , Month , date as input
All Date Objects
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    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-2024 All rights reserved worldwide Privacy Policy Disclaimer