Why do 2 time structs with the same date and time return false when compared with ==?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a time.Time created using time.Date() . I then calculate the number of nanoseconds between 1970/1/1 00:00:00.000000000 and that time. I then take the nanoseconds and turn them back into a time.Time using time.Unix() . However, if I compare the reconstituted time with the original using == , it returns false. If I subtract these 2 times, the resulting duration is 0. If I compare these 2 times using time.Equal() , it returns true. If I create another time using time.Date() with the same values as the first time, using == to