Skip to content

Bestfeel/godate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

go-date

安装

go  get  -u  github.com/Bestfeel/godate

时间格式化工具Example

godate -h

Usage: 日期格式化

月份 1,01,Jan,January
日  2,02,_2
时  3,03,15,PM,pm,AM,am
分  4,04
秒  5,05
年  06,2006
周几 Mon,Monday
时区时差表示 -07,-0700,Z0700,Z07:00,-07:00,MST
时区字母缩写 MST

godate -d="2017-11-10 18:22:34"  -f="2006-01-02 15:04:05"
godate -d="2017-11-10 18:22:34"  -f="2006-01-02 15:04:05" -s=1510338154
godate -s=1510338154


  -d string
        字符串日期格式【2017-11-10 18:22:34】
  -f string
        日期格式化[2006-01-02 15:04:05]
  -s int
        timstamp 时间格式【1510309374】

Example

➜  ~ godate
当前日期:2017-11-10 19:42:47
当前时间秒:1510314167

➜  ~ godate -d="2017-11-10 18:22:34"  -f="2006-01-02 15:04:05"
格式化时间:1510338154
➜  ~ godate -d="2017-11-10 18:22:34"  -f="2006-01-02 15:04:05" -s=1510338154
格式化时间:1510338154
格式化时间:2017-11-11 02:22:34
➜  ~ godate -s=1510338154
格式化时间:2017-11-11 02:22:34

About

go时间命令行工具

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages