在http://golang.org/src/pkg/time/time.go
62 // Equal reports whether t and u represent the same time instant.
63 // Two times can be equal even if they are in different locations.
64 // For example, 6:00 +0200 CEST and 4:00 UTC are Equal.
65 // This comparison is different from using t == u, which also compares
66 // the locations.
67 func (t Time) Equal(u Time) bool {
68 return t.sec == u.sec && t.nsec == u.nsec
69 }
Run Code Online (Sandbox Code Playgroud)
为什么他们不关心t.loc和u.loc?
更新:如果我有2台服务器(不同的位置),我如何判断他们的时间是否完全相同?
| 归档时间: |
|
| 查看次数: |
497 次 |
| 最近记录: |