Home > Backend Development > Golang > go-carbon1.2.4 is released! Added series time comparison method

go-carbon1.2.4 is released! Added series time comparison method

藏色散人
Release: 2020-11-06 15:01:53
forward
2548 people have browsed it

The following column golang tutorial will introduce to you about the go-carbon 1.2.4 version release, a new series of time comparison methods, I hope it will be helpful to friends who need it help!

go-carbon1.2.4 is released! Added series time comparison method

carbon is a lightweight, semantic, developer-friendly Golang time processing library that supports chain calls, lunar calendar and mainstream ORMs such as gorm and xorm

If you think it is good, please give it a star

github:github.com/golang-module/carbon
gitee:gitee.com/go-package/carbon
Copy after login

Installation and use

// 使用github库
go get -u github.com/golang-module/carbon

import (
 "github.com/golang-module/carbon")

// 使用gitee库
go get -u gitee.com/go-package/carbon

import (
 "gitee.com/go-package/carbon")
Copy after login

Update log

  • Deprecate the Duration() method and split it For AddDuration() and SubDuration()
  • Added Compare() method to compare time
  • Added Gt() method to determine whether it is greater than
  • Added Lt() method to determine Whether it is less than
  • New Eq() method to determine whether it is equal
  • New Ne() method to determine whether it is not equal
  • New Gte() method to determine whether it is greater than or equal
  • Added Lte() method to determine whether it is less than or equal to
  • Added Between() method to determine whether it is between two times (excluding these two times)
  • New Added BetweenIncludedStartTime() method to determine whether it is between two times (including the start time)
  • Added BetweenIncludedEndTime() method to determine whether it is between two times (including the end time)
  • New Added BetweenIncludedBoth() method to determine whether it is between two times (including these two times)

The above is the detailed content of go-carbon1.2.4 is released! Added series time comparison method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template