tyme4go

module
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT

README

Tyme License

Tyme是一个非常强大的日历工具库,可以看作 Lunar 的升级版,拥有更优的设计和扩展性,支持公历、农历、藏历、星座、干支、生肖、节气、法定假日等。

基于go1.19版本开发

示例

package main
 
import (
    "fmt"
    "github.com/6tail/tyme4go/tyme"
)
 
func main() {
    // 公历日
    solarDay, err := tyme.SolarDay{}.FromYmd(1986, 5, 29)

    // 参数有误无法创建公历日对象时,err错误信息不为空
    if err == nil {
      // 1986年5月29日
      fmt.Println(solarDay)
       
      // 农历丙寅年四月廿一
      fmt.Println(solarDay.GetLunarDay())

      // 第十七饶迥火虎年四月廿一
      fmt.Println(solarDay.GetRabByungDay())
    }
}

文档

请移步至 https://6tail.cn/tyme.html

Star History

Star History Chart

致谢

  1. 感谢许剑伟老师分享的寿星天文历,本项目节气算法引自 https://github.com/sxwnl/sxwnl
  2. 感谢stonelf,本项目藏历数据引自 https://github.com/stonelf/zangli

Directories

Path Synopsis
Package tyme @Title Tyme @Description 一个非常强大的日历工具库 @Author 6tail
Package tyme @Title Tyme @Description 一个非常强大的日历工具库 @Author 6tail

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL