From 9c5e574c80e95c03699fd0eb3ae7e2e8c5e481d4 Mon Sep 17 00:00:00 2001 From: Peleus <245629560@qq.com> Date: Mon, 22 Jan 2024 17:23:00 +0800 Subject: [PATCH] Update content --- README.md | 97 ------------------------------------------------------- 1 file changed, 97 deletions(-) diff --git a/README.md b/README.md index 97a8f7ca..b5beaa2e 100644 --- a/README.md +++ b/README.md @@ -1181,103 +1181,6 @@ carbon.Parse("2020-08-05 13:14:15").IsAutumn() // false carbon.Parse("2020-08-05 13:14:15").IsWinter() // false ``` -##### Lunar - -> Currently only `200` years from `1900` to `2100` are supported - -```go -// Get Chinese Lunar year of animal -carbon.Parse("2020-08-05 13:14:15").Lunar().Animal() // 鼠 - -// Get Chinese lunar festival -carbon.Parse("2021-02-12 13:14:15").Lunar().Festival() // 春节 - -// Get Chinese lunar year, month, day, hour, minute and second -carbon.Parse("2020-08-05 13:14:15").Lunar().DateTime() // 2020, 6, 16, 13, 14, 15 -// Get Chinese lunar year, month and day -carbon.Parse("2020-08-05 13:14:15").Lunar().Date() // 2020, 6, 16 -// Get Chinese lunar hour, minute and second -carbon.Parse("2020-08-05 13:14:15").Lunar().Time() // 13, 14, 15 - -// Get Chinese lunar year -carbon.Parse("2020-08-05 13:14:15").Lunar().Year() // 2020 -// Get Chinese lunar month -carbon.Parse("2020-08-05 13:14:15").Lunar().Month() // 6 -// Get Chinese lunar leap month -carbon.Parse("2020-08-05 13:14:15").Lunar().LeapMonth() // 4 -// Get Chinese lunar day -carbon.Parse("2020-08-05 13:14:15").Lunar().Day() // 16 -// Get Chinese lunar date as YYYY-MM-DD HH::ii::ss format string -fmt.Printf("%s", carbon.Parse("2020-08-05 13:14:15").Lunar()) // 2020-06-16 13:14:15 - -// Get Chinese lunar year as string -carbon.Parse("2020-08-05 13:14:15").Lunar().ToYearString() // 二零二零 -// Get Chinese lunar month as string -carbon.Parse("2020-08-05 13:14:15").Lunar().ToMonthString() // 六月 -// Get Chinese lunar day as string -carbon.Parse("2020-08-05 13:14:15").Lunar().ToDayString() // 十六 -// Get Chinese lunar date as string -carbon.Parse("2020-08-05 13:14:15").Lunar().ToDateString() // 二零二零年六月十六 - -// Whether is a leap year -carbon.Parse("2020-08-05 13:14:15").Lunar().IsLeapYear() // true -// Whether is a leap month -carbon.Parse("2020-08-05 13:14:15").Lunar().IsLeapMonth() // false - -// Whether is a year of the rat -carbon.Parse("2020-08-05 13:14:15").Lunar().IsRatYear() // true -// Whether is a year of the ox -carbon.Parse("2020-08-05 13:14:15").Lunar().IsOxYear() // false -// Whether is a year of the tiger -carbon.Parse("2020-08-05 13:14:15").Lunar().IsTigerYear() // false -// Whether is a year of the rabbit -carbon.Parse("2020-08-05 13:14:15").Lunar().IsRabbitYear() // false -// Whether is a year of the dragon -carbon.Parse("2020-08-05 13:14:15").Lunar().IsDragonYear() // false -// Whether is a year of the snake -carbon.Parse("2020-08-05 13:14:15").Lunar().IsSnakeYear() // false -// Whether is a year of the horse -carbon.Parse("2020-08-05 13:14:15").Lunar().IsHorseYear() // false -// Whether is a year of the goat -carbon.Parse("2020-08-05 13:14:15").Lunar().IsGoatYear() // false -// Whether is a year of the monkey -carbon.Parse("2020-08-05 13:14:15").Lunar().IsMonkeyYear() // false -// Whether is a year of the rooster -carbon.Parse("2020-08-05 13:14:15").Lunar().IsRoosterYear() // false -// Whether is a year of the dog -carbon.Parse("2020-08-05 13:14:15").Lunar().IsDogYear() // false -// Whether is a year of the dig -carbon.Parse("2020-08-05 13:14:15").Lunar().IsPigYear() // false - -// Get Chinese double-hour -carbon.Parse("2020-02-05 21:00:00").Lunar().DoubleHour() // 亥时 - -// Whether is FirstDoubleHour -carbon.Parse("2020-03-21 00:00:00").Lunar().IsFirstDoubleHour() // true -// Whether is SecondDoubleHour -carbon.Parse("2020-03-21 01:00:00").Lunar().IsSecondDoubleHour() // true -// Whether is ThirdDoubleHour -carbon.Parse("2020-03-21 03:00:00").Lunar().IsThirdDoubleHour() // true -// Whether is FourthDoubleHour -carbon.Parse("2020-03-21 05:00:00").Lunar().IsFourthDoubleHour() // true -// Whether is FifthDoubleHour -carbon.Parse("2020-03-21 07:00:00").Lunar().IsFifthDoubleHour() // true -// Whether is SixthDoubleHour -carbon.Parse("2020-03-21 09:00:00").Lunar().IsSixthDoubleHour() // true -// Whether is SeventhDoubleHour -carbon.Parse("2020-03-21 11:00:00").Lunar().IsSeventhDoubleHour() // true -// Whether is EighthDoubleHour -carbon.Parse("2020-03-21 13:00:00").Lunar().IsEighthDoubleHour() // true -// Whether is NinthDoubleHour -carbon.Parse("2020-03-21 15:00:00").Lunar().IsNinthDoubleHour() // true -// Whether is TenthDoubleHour -carbon.Parse("2020-03-21 17:00:00").Lunar().IsTenthDoubleHour() // true -// Whether is EleventhDoubleHour -carbon.Parse("2020-03-21 19:00:00").Lunar().IsEleventhDoubleHour() // true -// Whether is TwelfthDoubleHour -carbon.Parse("2020-03-21 21:00:00").Lunar().IsTwelfthDoubleHour() // true -``` - ##### JSON ###### Scene one: all time fields have the same format