Tests: Add DateTime unit test
This commit is contained in:
parent
06744f356c
commit
cafe615ab5
1 changed files with 5 additions and 0 deletions
|
@ -119,6 +119,11 @@ func TestDateTime(t *testing.T) {
|
|||
assert.Equal(t, "2020-10-17 17:48:24.9508123 +0000 UTC", result.UTC().String())
|
||||
assert.Equal(t, "2020-10-17 17:48:24.9508123", result.Format("2006-01-02 15:04:05.999999999"))
|
||||
})
|
||||
t.Run("2022-09-03T17:48:26-07:00", func(t *testing.T) {
|
||||
result := DateTime("2022-09-03T17:48:26-07:00", "")
|
||||
assert.Equal(t, "2022-09-04 00:48:26 +0000 UTC", result.UTC().String())
|
||||
assert.Equal(t, "2022-09-03 17:48:26", result.Format("2006-01-02 15:04:05"))
|
||||
})
|
||||
}
|
||||
|
||||
func TestIsTime(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue