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

About DiffAbsInMonths #189

Closed
LonelySally opened this issue Oct 26, 2023 · 4 comments
Closed

About DiffAbsInMonths #189

LonelySally opened this issue Oct 26, 2023 · 4 comments
Labels
Question Indicates that an issue, pull request, or discussion needs more information

Comments

@LonelySally
Copy link

月份差是以固定30天的步进作为计算,这与excel的DATEDIF函数计算结果不一致.

@LonelySally LonelySally added the Question Indicates that an issue, pull request, or discussion needs more information label Oct 26, 2023
@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The monthly difference is calculated in a fixed 30-day step, which is inconsistent with the calculation results of excel's DATEDIF function.

@Issues-translate-bot Issues-translate-bot changed the title 关于DiffAbsInMonths About DiffAbsInMonths Oct 26, 2023
@LonelySally
Copy link
Author

fmt.Println(carbon.CreateFromDate(2023, 10, 26).DiffAbsInMonths(carbon.CreateFromDate(2023, 12, 25))) // 2

WPS:

=DATEDIF("2023/10/26","2023/12/25","m") //1

@LonelySally
Copy link
Author

2.2.1升级到2.2.11输出一致

@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The output from 2.2.1 upgraded to 2.2.11 is consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Indicates that an issue, pull request, or discussion needs more information
Development

No branches or pull requests

2 participants