Created
March 20, 2019 05:41
-
-
Save edgarrmondragon/7881dc15ee7d032326d5637ed7bcfadc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pendulum | |
date_period = pendulum.period( | |
pendulum.datetime(2019, 1, 1), | |
pendulum.datetime(2019, 3, 20), | |
) | |
for dt in date_period.range("days"): | |
start, end = dt.start_of("day"), dt.end_of("end") | |
print(start, end) | |
# 2019-02-16T00:00:00+00:00 2019-02-16T23:59:59.999999+00:00 | |
# 2019-02-17T00:00:00+00:00 2019-02-17T23:59:59.999999+00:00 | |
# 2019-02-18T00:00:00+00:00 2019-02-18T23:59:59.999999+00:00 | |
# 2019-02-19T00:00:00+00:00 2019-02-19T23:59:59.999999+00:00 | |
# 2019-02-20T00:00:00+00:00 2019-02-20T23:59:59.999999+00:00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment