w3resource

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.

Sample Solution:

Python Code:

import arrow
a = arrow.utcnow()
print("Current datetime:")
print(a)
print("\nProleptic Gregorian ordinal of the date:")
print(arrow.utcnow().toordinal())

Sample Output:

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?

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://198.211.115.131/python-exercises/arrow/python-arrow-exercise-25.php