go-naturaldate

Natural date/time parsing for Go.

Github星跟踪图

Go Natural Date

Natural date time parsing for Go. This package was designed for parsing human-friendly relative date/time ranges in Apex Logs' command-line log search.

Examples

Here are some examples of the types of expressions currently supported, arbitrary text is currently ignored.

  • now
  • today
  • yesterday
  • 5 minutes ago
  • three days ago
  • last month
  • next month
  • one year from now
  • yesterday at 10am
  • last sunday at 5:30pm
  • sunday at 22:45
  • next January
  • last February
  • December 25th at 7:30am
  • 10am
  • 10:05pm
  • 10:05:22pm
  • Restart the server in 5 days from now
  • Remind me on the 25th of December at 7:30am
  • Message me in two weeks
  • See the tests for more examples

Direction

A default direction can be applied using WithDirection() for ambiguous expressions such as sunday, or september. By default naturaldate.Past is used, so they will be equivalent to last sunday and last september.


GoDoc

Sponsors

This project is sponsored by CTO.ai, making it easy for development teams to create and share workflow automations without leaving the command line.

主要指标

概览
名称与所有者tj/go-naturaldate
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2019-11-26 14:35:09
推送于2024-05-17 02:54:15
最后一次提交2020-06-08 17:22:18
发布数4
最新版本名称v1.3.0 (发布于 2020-06-08 17:22:18)
第一版名称v1.0.0 (发布于 )
用户参与
星数304
关注者数8
派生数16
提交数15
已启用问题?
问题数11
打开的问题数5
拉请求数2
打开的拉请求数1
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?