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 Python skills with w3resource's quiz



Python: Tips of the Day

Python: Chaining Of Comparison Operators

Example:

n = 20
test = 1 < n < 30
print(test)

Output:

True

Example:

test = 1 > n <= 9
print(test)

Output:

False