Change Log
v2.6.14 (2025-10-28)
- Optimize time addition and subtraction series methods in
traveler.gofile to ensure immutability by copying instances to avoid modifying the original instance - Add
Greeklocalised language support - Add
Finnishlocalised language support - Add
Myanmarlocalised language support
v2.6.13 (2025-10-15)
- Use
sync.OnceinSetLocalemethod oflanguage.goto ensure language files are loaded only once, and usesync.Mapfor thread-safe caching - Add boundary checks for escape character handling in
format2layoutmethod ofhelper.goto preventpaniccaused by out-of-bounds access
v2.6.12 (2025-09-16)
- Lower
golangenvironment dependency from1.21to1.18 - Upgrade
testifytesting framework fromv1.10.0tov1.11.1 - Set
isEmptyflag inUnmarshalJSONmethod oftype_carbon.gofile to indicate empty values - Use
sync.Mapto implement high-performance concurrent caching - Fix potential race conditions and null pointer dereference issues, improving concurrency safety
v2.6.11 (2025-07-18)
- Change
Sleepfrom struct method to global method - Refactor
Persiancalendar and add benchmark test files - Refactor
Chinese Lunarcalendar and add benchmark test files - Refactor
Julian/Modified Juliancalendar and add benchmark test files - Add
Hebrewcalendar support and add unit tests and benchmark test files - Add overall performance test report file
v2.6.10 (2025-07-07)
- Change
Japanesetranslation file fromjp.jsontoja.jsonand rename document fromREADME.jp.mdtoREADME.ja.mdto comply with the ISO639-1 standard - Remove deprecated
ParseWithLayoutsmethod and replace withParseByLayoutsmethod - Remove deprecated
ParseWithFormatsmethod and replace withParseByFormatsmethod - Remove deprecated
CleanTestNowmethod and replace withClearTestNowmethod - Remove parsing support for timestamp strings from
ParseByLayoutandParseByFormatmethods, useCreateFromTimestamp,CreateFromTimestampMilli,CreateFromTimestampMicro,CreateFromTimestampNanoto parse timestamp strings - Optimize
getAbsValuemethod inhelper.goto replace conditional judgments withbitwise operation - Optimize the methods related to time freezing in
frozen.go, reduce lock contention usingatomic operationand optimize memory allocation - Optimize benchmark test files to cover
serialtesting,paralleltesting andconcurrenttesting - Add Korean readme document
README.ko.md - Add
Sleepmethod and relatedunit tests,benchmark tests, andexample file - Add number constants such as
MaxYear,MinYear,MaxMonth,MinMonth,MaxDay,MinDayetc. and replace hard coded with these constants
v2.6.9 (2025-06-28)
- Remove the implementation of the
GormDataTypeinterface forgorm
v2.6.8 (2025-06-12)
- Parsing when layouts or formats is empty, returns a error
- Upgrade
gorm.io/gormfrom1.21.1to1.30.0intests - Upgrade
gorm.io/driver/mysqlfrom1.5.7to1.6.0intests - Upgrade
gorm.io/driver/postgresfrom1.5.7to1.6.0intests - Upgrade
gorm.io/driver/sqlitefrom1.5.7to1.6.0intests - Rename
DateTimeTypetodateTimeType,DateTimeXXXTypetodateTimeXXXTypeintype_builtin.go - Rename
DateTypetodateType,DateXXXTypetodateXXXTypeintype_builtin.go - Rename
TimeTypetotimeType,TimeXXXTypetotimeXXXTypeintype_builtin.go - Simplify readme file and migrate overview and example usage to the official doc website
- Add HelloGitHub badge link
v2.6.7 (2025-05-26)
Stringmethod removes the check for null value carbon- Rename
type_interface.gofile tointerfaces.go - Change the second parameter of the
Closest/Farthestmethods to an optional parameter - Add
ZeroValue/EpochValuemethods - Add
DataTyperinterface, and enable builtin types to implement theDataTyperinterface
v2.6.6 (2025-05-19)
- Fix bug locale file cannot be found on
Windowsos - Fix bug lose of values of
layout,weekStartsAt,weekendDaysandlangwhen create newCarboninstance - Fix bug
StartOfWeekandEndOfWeekmethods change originalCarboninstance Unexpectedly - Add
curdintegration testing forxorm, currently coveringMySQL/Postgres/SQLite - Add unit testing for the
Windowsos inciaction
v2.6.5 (2025-05-14)
- Upgrade
goversion from1.18to1.21 SetLanguagemethod ofCarbonstruct add check for invalidLanguagestructParsemethod ofCarbonstruct add support forPostgres/SQLitetime format stringParse/ParseByLayout/ParseByFormatmethods ofCarbonstruct change the return value fromniltoemptycarbon when parsing anemptystringCarbonstruct addIsEmptymethod to determine if it is anemptycarbonCarbonstruct addClearTestNowmethod to replaceCleanTestNow,CleanTestNowwill be removed in the futureCarbonstruct addParseByLayoutsmethod to replaceParseWithLayouts,ParseWithLayoutswill be removed in the futureCarbonstruct addParseByFormatsmethod to replaceParseWithFormats,ParseWithFormatswill be removed in the futureCarbonstruct removeGormDataTypemethod and changeValue/MarshalJSONmethods frompointerreceiver tovaluereceiverLayoutType[T]struct removeGormDataTypemethod and changeValue/MarshalJSONmethods frompointerreceiver tovaluereceiverFormatType[T]struct removeGormDataTypemethod and changeValue/MarshalJSONmethods frompointerreceiver tovaluereceiverTimestampType[T]struct removeGormDataTypemethod and changeValue/MarshalJSONmethods frompointerreceiver tovaluereceiverSetResourcesmethod ofLanguagestruct add check invalid resources- Add
curdintegration testing forgorm, currently coveringMySQL/Postgres/SQLite - Replace
github.com/stretchr/testify/assertwithgithub.com/stretchr/testify/suitefor unit testing
v2.6.4 (2025-04-28)
- Fix panic when database field type was
nil - Split
database_types.gointotype_carbon.go,type_layout.go,type_format.go,type_timestamp.go - Rename
LayoutFactoryinterface toLayoutTyperandSetLayoutmethod toLayout - Rename
FormatFactoryinterface toFormatTyperandSetFormatmethod toFormat - Rename
TimestampFactoryinterface toTimestampTyperandSetPrecisionmethod toPrecision - Add
b.ResetTimer()in benchmark test files - Add
Copymethod forLanguagestruct - Add
carbon.Timestamptype alias andcarbon.NewTimestampmethod - Add
carbon.TimestampMillitype alias andcarbon.NewTimestampMillimethod - Add
carbon.TimestampMicrotype alias andcarbon.NewTimestampMicromethod - Add
carbon.TimestampNanotype alias andcarbon.NewTimestampNanomethod - Add
carbon.DateTimetype alias andcarbon.NewDateTimemethod - Add
carbon.DateTimeMicrotype alias andcarbon.NewDateTimeMicromethod - Add
carbon.DateTimeMillitype alias andcarbon.NewDateTimeMillimethod - Add
carbon.DateTimeNanotype alias andcarbon.NewDateTimeNanomethod - Add
carbon.Datetype alias andcarbon.NewDatemethod - Add
carbon.DateMillitype alias andcarbon.NewDateMillimethod - Add
carbon.DateMicrotype alias andcarbon.NewDateMicromethod - Add
carbon.DateNanotype alias andcarbon.NewDateNanomethod - Add
carbon.Timetype alias andcarbon.NewTimemethod - Add
carbon.TimeMillitype alias andcarbon.NewTimeMillimethod - Add
carbon.TimeMicrotype alias andcarbon.NewTimeMicromethod - Add
carbon.TimeNanotype alias andcarbon.NewTimeNanomethod
v2.6.3 (2025-04-21)
- Fix bug with the same results in different countries using
IsWeekendandIsWeekdaymethods. - Fix bug
carbon.Parse("").StdTime()cause a nil pointer panic. #294 - Change errors from
privatemethod topublicmethod. - Change the default start date of the week from
SundaytoMonday - Change the year of
MinValuefrom-9998to1 - Change
weeksPerLongYearconstant toWeeksPerLongYear - Add benchmark test files
xxx_bench_test.go - Add
IsEpochmethod to report whether is a unix epoch time(1970-01-01 00:00:00 +0000 UTC). - Add
WeekEndsAtmethod to get end day of the week. - Add
SetWeekendDaysmethod to set weekend days of the week. - Add
DefaultWeekStartsAtglobal variable to store weekend days of the week.
v2.6.2 (2025-04-08)
- Remove
hour,Minute,secondparameter inCreateFromLunar,CreateFromPersianmethods - Change some format symbol definitions involves symbols such as
U,V,X,S,TZ,u,v,x,z - Fix bug of incorrect judgment of
IsLeapMonthin lunar calendar - Fix bug of
AtomFormatandAtomLayoutreturn inconsistent value - Fix bug of
RFC3339FormatandRFC3339Layoutreturn inconsistent value time.Localis not updated when setting global time zone- Add format symbol
oto get time zone offset - Add
TimestampLayout,TimestampMilliLayout,TimestampMicroLayoutandTimestampNanoLayoutconstants - Add
TimestampFormat,TimestampMilliFormat,TimestampMicroFormatandTimestampNanoFormatconstants - Add
DateTimeMilli,DateTimeMicro,DateTimeNanofield types - Add
DateMilli、DateMicro、DateNanofield types - Add
TimeMilli、TimeMicro、TimeNanofield types - Fix missing timezone bug in
IsDSTmethod - Fix missing timezone bug
StartOfXXX,EndOfXXXmethods - Fix missing timezone bug when converting other calendars to
Gregoriancalendar time.Localis not updated when setting default timezone- Add
MaxDuration,MinDurationmethods
v2.6.1 (2025-03-27)
- Add
ParseWithLayoutsandParseWithFormatsmethods - Rename
formatFactoryinterface toFormatFactory,layoutFactoryinterface toLayoutFactory,timestampFactoryinterface toTimestampFactory, and add type constraints - Change the return value of the
GormDataTypemethod of theLayoutType,FormatType,TimestampTypestructtotime - Change
DateTime,Date,Timetypes fromstructtostring - Change
Timestamp、TimestampMilli、TimestampMicro,TimestampNanotypes fromstructtoint64 - Move built-in database field types to new file
types.go - Fixed
updated_atfield is automatically updated and invalid whengormupdates data
v2.6.0 (2025-03-25)
golangminimum version dependency upgraded to1.18carbon,julian,lunar,persianchanged from value passing to pointer passing- Add
ZoneNamemethod to get the time zone name - Add
HasErrormethod to check if there is an error - Add
IsNilmethod to check if it isnil - Add
Copymethod to deep copycarbon - Add
WeekStartsAtmethod to get start day of the week - Add example file
xxx_example.go - Add a new
constant.gofile and migrate constants from thecarbon.gofile to this file - Change default global timezone from
LocaltoUTC - Rename
Offsetmethod toZoneOffsetmethod - Rename
IsSetTestNowmethod toIsTestNowmethod - Rename
UnSetTestNowmethod toCleanTestNowmethod - Remove
Locationmethod, replaced byTimezonemethod - Change the judgment logic of
IsValidandIsInvalidmethods,zero timeis no longer considered invalid time - Update
time.Localwhen setting the global default timezone - Refactor
database.goand removecarbon.DateTime,carbon. DateTimeMilli,carbon.DateTimeMicro,carbon.DateTimeNano,carbon. Date,carbon.DateMilli,carbon.DateMicro,carbon.DateNano,carbon.Time,carbon.TimeMilli,carbon.TimeMicro,carbon.TimeNano,carbon.Timestamp,carbon.TimestampMilli,carbon.TimestampMicro,carbon.TimestampNanofield types, use generic fields instead to implement custom output format whenMarshalJSON/UnmarshalJSON
Refer to releases for change logs of earlier versions