-
Notifications
You must be signed in to change notification settings - Fork 18k
time.AddDate() can't get Feb #31130
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
Comments
From docs:
So if you do " |
Closing because this is working as documented and expected. |
This is so ridiculous. Obviously just because something is documented and expected doesn't mean it's right. It makes no sense that adding a month to January results in March. Momentjs and Java don't work this way. I had to write a Date library in C a long time ago and this wouldn't fly then. I understand why the developers are sticking to this narrative but I think it's silly. |
Please see the comment I just added to #31145 (#31145 (comment)) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I don't try 1.12
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
2019/03/29 16:11:39 curTime: 2019-03-29 16:11:39.1469807 +0800 CST m=+0.002000201
2019/03/29 16:11:39 lastMonthTime: 2019-03-01 16:11:39.1469807 +0800 CST
What did you expect to see?
If -1 I expect to see the time is Feb
What did you see instead?
The text was updated successfully, but these errors were encountered: