Python Arrow Module: Get the proleptic Gregorian ordinal of a given date
Arrow Module: Exercise-25 with Solution
Write a Python program to get the proleptic Gregorian ordinal of a given date.
import arrow a = arrow.utcnow() print("Current datetime:") print(a) print("\nProleptic Gregorian ordinal of the date:") print(arrow.utcnow().toordinal())
Current datetime: 2019-06-04T07:02:32.671600+00:00 Proleptic Gregorian ordinal of the date: 737214
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a Python program to create a time object with the same hour, minute, second, microsecond and timezone info.
Next: Write a Python program to get string representing the date, controlled by an explicit format string.
What is the difficulty level of this exercise?
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework