w3resource

Python Arrow Module: Create a new Arrow object, cloned from the current one

Arrow Module: Exercise-11 with Solution

Write a Python program to create a new Arrow object, cloned from the current one.

Sample Solution:

Python Code:

import arrow
a = arrow.utcnow()
print("Current datetime:")
print(a)
cloned = a.clone()
print("\nCloned datetime:")
print(cloned)

Sample Output:

Current datetime:
2019-06-01T10:50:46.486000+00:00

Cloned datetime:
2019-06-01T10:50:46.486000+00:00

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 string representation of the Arrow object, formatted according to a format string.
Next: Write a Python program to create a datetime object, converted to the specified timezone using arrow module.

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-11.php