Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
dtapps | d2fc1af3be | 4 days ago |
dtapps | 1b8a3a8b18 | 2 weeks ago |
dtapps | e25da0cbd4 | 2 months ago |
@ -0,0 +1,21 @@
|
||||
package gotime
|
||||
|
||||
const (
|
||||
DateTimeFormat = "2006-01-02 15:04:05"
|
||||
DateTimeSFormat = "2006-01-0215:04:05"
|
||||
DateTimeShrinkFormat = "2006-01-02 15:04"
|
||||
DateTimeShrinkSFormat = "2006-01-0215:04"
|
||||
DateFormat = "2006-01-02"
|
||||
TimeFormat = "15:04:05"
|
||||
TimeShrinkFormat = "15:04"
|
||||
)
|
||||
|
||||
const (
|
||||
DateTimeZhFormat = "2006年01月02日 15点04分05秒"
|
||||
DateTimeZhSFormat = "2006年01月02日15点04分05秒"
|
||||
DateTimeZhShrinkFormat = "2006年01月02日 15点04分"
|
||||
DateTimeZhShrinkSFormat = "2006年01月02日15点04分"
|
||||
DateZhFormat = "2006年01月02日"
|
||||
TimeZhFormat = "15点04分05秒"
|
||||
TimeZhShrinkFormat = "15点04分"
|
||||
)
|
@ -0,0 +1,23 @@
|
||||
package gotime
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFormat(t *testing.T) {
|
||||
t.Log("DateTimeFormat", Current().SetFormat(DateTimeFormat))
|
||||
t.Log("DateTimeSFormat", Current().SetFormat(DateTimeSFormat))
|
||||
t.Log("DateTimeShrinkFormat", Current().SetFormat(DateTimeShrinkFormat))
|
||||
t.Log("DateTimeShrinkSFormat", Current().SetFormat(DateTimeShrinkSFormat))
|
||||
t.Log("DateFormat", Current().SetFormat(DateFormat))
|
||||
t.Log("TimeFormat", Current().SetFormat(TimeFormat))
|
||||
t.Log("TimeShrinkFormat", Current().SetFormat(TimeShrinkFormat))
|
||||
}
|
||||
|
||||
func TestZhFormat(t *testing.T) {
|
||||
t.Log("DateTimeZhFormat", Current().SetFormat(DateTimeZhFormat))
|
||||
t.Log("DateTimeZhSFormat", Current().SetFormat(DateTimeZhSFormat))
|
||||
t.Log("DateTimeZhShrinkFormat", Current().SetFormat(DateTimeZhShrinkFormat))
|
||||
t.Log("DateTimeZhShrinkSFormat", Current().SetFormat(DateTimeZhShrinkSFormat))
|
||||
t.Log("DateZhFormat", Current().SetFormat(DateZhFormat))
|
||||
t.Log("TimeZhFormat", Current().SetFormat(TimeZhFormat))
|
||||
t.Log("TimeZhShrinkFormat", Current().SetFormat(TimeZhShrinkFormat))
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
package gotime
|
||||
|
||||
const Version = "1.0.7"
|
||||
const Version = "1.0.10"
|
||||
|
Loading…
Reference in new issue