Comments (13)
Thank you for your feedback, I will seriously consider it.
from carbon.
If you need help, I'd be happy to provide it.
from carbon.
If you don't want to change the name, then perhaps the notes should be written more clearly? Because as it stands now, the notes don't describe what the functions do very clearly.
from carbon.
I also hesitated when I first named it, CreateFromDate
is to be consistent with CreateFromTime
, in CreateFromTime
, the year, month, and day are taken from current time, so, all omitted values are taken to the current time.
from carbon.
Yesterday
and Tomorrow
have the same logic,hours, minutes and seconds are taken from the current time.
from carbon.
2023-01-01 Current Hour: Current Minutes: Current Seconds Current Nanoseconds
? No Current Nanoseconds
from carbon.
Currently can use the following methods
carbon.CreateFromDate(2023,1,1).StartOfDay()
// 2023-01-01 00:00:00
from carbon.
I know that I can also use carbon.CreateFromDateTimeNano
. But the confusing nature of function names is still there.
from carbon.
Nanoseconds exist in your concrete realization.
2023-01-01 Current Hour: Current Minutes: Current Seconds Current Nanoseconds
? NoCurrent Nanoseconds
from carbon.
What should be the year, month and day in CreateFromTime
? 0000-00-00
or currentYear-currentMonth-currentDay
from carbon.
What should be the year, month and day in
CreateFromTime
?0000-00-00
orcurrentYear-currentMonth-currentDay
currentYear-currentMonth-currentDay
maybe this, but nobody can kown this from func name or func comment
from carbon.
What should be the year, month and day in
CreateFromTime
?0000-00-00
orcurrentYear-currentMonth-currentDay
As you said, is it 0000-00-00 or currentYear-currentMonth-currentDay which is unknown to the user?
from carbon.
from carbon.
Related Issues (20)
- My local time is Asia/Shanghai, But the time from the database is UTC HOT 6
- Default JSON template settings HOT 1
- Wrong zodiac sign HOT 2
- Starting from v2.3.0, after removing the series of methods such as DateTime, it is extremely inconvenient to insert the birthday (Y-m-d) field with gorm now. What is the best practice HOT 11
- build for windows_386 (untyped int constant) overflows int HOT 6
- How to get time.Duration in two carbon instances? ? HOT 1
- ParseByFormat fails to detect location Location HOT 2
- cannot parse string null HOT 3
- DiffAbsInDuration must upgrade go version to 1.9+ HOT 3
- Can you add the 1.5.5 tag? HOT 4
- Incorrect Parse of 0001-01-01 00:00:00 HOT 7
- How to loadTag a slice list? HOT 1
- IsToday()、IsYesterday()、IsTomorrow()in other timeZone is invaild HOT 1
- why tag v1.5.5 is not exist HOT 1
- AddQuarters(-1) incorrect result HOT 3
- Why is this formatting different from the stdlib? HOT 3
- method: a.DiffInDuration(b) is b-a ! This is not in line with intuition HOT 1
- json null value
- different timezone,return the same string HOT 2
- gorm Using carbon.Carbon will add one more time zone HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbon.