w3resource

Python Arrow Module: Create a naïve (without time zone) datetime representation of the Arrow object

Arrow Module: Exercise-21 with Solution

Write a Python program to create a naïve (without time zone) datetime representation of the Arrow object.

Sample Solution:

Python Code:

import arrow
a = arrow.utcnow()
print("Current datetime:")
print(a)
r = arrow.now('US/Mountain')
print("\nNaive datetime representation:")
print(r.naive)

Sample Output:

Current datetime:
2019-06-04T06:18:34.133600+00:00

Naive datetime representation:
2019-06-04 00:18:35.215600

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 3-tuple ISO year, ISO week number, ISO weekday and an ISO 8601 formatted representation of the date and time.
Next: Write a Python program to create a time object with the same hour, minute, second, microsecond and a timestamp representation of the Arrow object, in UTC time.

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://www.w3resource.com/python-exercises/arrow/python-arrow-exercise-21.php