Skip to content

How to advance to next month #131

Answered by BurntSushi
tisonkun asked this question in Q&A
Discussion options

You must be logged in to vote

For the specific error you're seeing, see #1.

As for how to advance to the next month, just add it: zdt.checked_add(1.month()).

It looks like you're doing that already. So it looks like what your code is doing is something more than just "go to next month." Perhaps what you want is to "go to the first day of the next month." I would do that by zdt.first_of_month()?.checked_add(1.month())?.

Also, in the future, please provide a complete MRE. Thanks.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@tisonkun
Comment options

@tisonkun
Comment options

@BurntSushi
Comment options

Answer selected by tisonkun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants