-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime_test.go
50 lines (37 loc) · 1.01 KB
/
time_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package rose
import "testing"
func TestTimeNow10(t *testing.T) {
t.Log(TNowS())
}
func TestTimeNow13(t *testing.T) {
t.Log(TNowMs())
}
func TestParseGMTTime(t *testing.T) {
tt, _ := TParseGMTSTTE("Mon, 20 Jul 2020 06:09:21 GMT")
t.Log(tt.Unix())
t.Log(TUnixSFormat(tt.Unix(), TFLongYMDHS))
}
func TestTSecByDay(t *testing.T) {
//tt := TSecByMin(5)
//tt := TSecByDay(3)
//tt := TSecByMonth(2)
//t.Log(tt)
t.Log(TMonthStartTime())
t.Log(TMonthEndTime())
}
func TestTSecToAdd(t *testing.T) {
//t.Log(TUnixSToDateTime(TSecToAdd(1, 1, 0)))
//t.Log(DelayTimeToTomorrow(3, "00:00:00") - 1)
//t.Log(TEndTheDayRemainSec() + 3600)
//t.Log(TSecUntilNowToAddY(0, 0, 1, 1, 0, 0))
//t.Log(TUnixSNowToAddY(0, 0, 0, 0, 0, 0))
t.Log(TSecUntilNowToAddY(0, 0, 0, 0, 45, 0))
//t.Log(TUnixSToDateTime(TNowAddUnixSDHM(-1, 0, 0)))
//t.Log(TMonthEndStr())
t.Log(TNowAddIntervalSecDHM(0, 0, 45))
}
func TestTFormatSec(t *testing.T) {
t.Log(TFormatSec(3505, true))
t.Log(TSecFormatMS(3505))
t.Log(TSecFormatHMS(3505))
}