Ai
2 Star 0 Fork 0

cockroachdb/teamcity

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jsontime.go 539 Bytes
一键复制 编辑 原始数据 按行查看 历史
Alexandre Bourget 提交于 2015-12-16 05:42 +08:00 . TeamCity API, first extraction draft
package teamcity
import "time"
// JSONTime is just a string wrapper for Team City's date format.
type JSONTime string
// Time parses the string to extract a time.Time object.
func (t JSONTime) Time() time.Time {
t0, err := time.Parse("20060102T150405-0700", string(t))
if err != nil {
return time.Time{}
}
return t0
}
// Empty checks if the JSONTime was specified at all
func (t JSONTime) Empty() bool {
return t == ""
}
// IsZero returns whether the date is zero.
func (t JSONTime) IsZero() bool {
return t.Time().IsZero()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_cockroachdb/teamcity.git
git@gitee.com:mirrors_cockroachdb/teamcity.git
mirrors_cockroachdb
teamcity
teamcity
8ca25c33eb11

搜索帮助