Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do get the previous month's time? #61

Open
who0sy opened this issue Jul 20, 2022 · 1 comment
Open

How do get the previous month's time? #61

who0sy opened this issue Jul 20, 2022 · 1 comment
Assignees

Comments

@who0sy
Copy link

who0sy commented Jul 20, 2022

example:
now = 2022-03-01 10:00:00

I want to get 2022-02-01 10:00:00

How can this be done quickly?thanks

@nannul
Copy link

nannul commented Dec 2, 2022

You can try carbon
carbon.Parse("2022-03-01 10:00:00").SubMonth() // 2022-02-01 10:00:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants