mirror of
https://github.com/astaxie/beego.git
synced 2024-11-14 17:10:54 +00:00
commit
fbde7df487
@ -8,11 +8,12 @@ import (
|
|||||||
|
|
||||||
func TestWebTime(t *testing.T) {
|
func TestWebTime(t *testing.T) {
|
||||||
ts := "Fri, 26 Jul 2013 12:27:42 CST"
|
ts := "Fri, 26 Jul 2013 12:27:42 CST"
|
||||||
tt, _ := time.Parse(time.RFC1123, ts)
|
l, _ := time.LoadLocation("GST")
|
||||||
|
tt, _ := time.ParseInLocation(time.RFC1123, ts, l)
|
||||||
if ts != webTime(tt) {
|
if ts != webTime(tt) {
|
||||||
t.Error("should be equal")
|
t.Error("should be equal")
|
||||||
}
|
}
|
||||||
if "Fri, 26 Jul 2013 04:27:42 GMT" != webTime(tt.UTC()) {
|
if "Fri, 26 Jul 2013 12:27:42 GMT" != webTime(tt.UTC()) {
|
||||||
t.Error("should be equal")
|
t.Error("should be equal")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user