Commit fd39ac92 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 113ab6ab
......@@ -33,7 +33,7 @@ func (tid Tid) Time() TimeStamp {
month := a / (60 * 24 * 31) % 12 + 1
year := a / (60 * 24 * 31 * 12) + 1900
sec := b * 60 / (1 << 32)
nsec := (b - (sec << 32) / 60) * 60 * 1E9 / (1 << 32)
nsec := (b * 60 - (sec << 32)) * 1E9 / (1 << 32)
t := time.Date(
int(year),
......
......@@ -11,6 +11,7 @@ func TestTidTime(t *testing.T) {
var testv = []struct {tid Tid; timeStr string} {
{0x0000000000000000, "1900-01-01 00:00:00.000000"},
{0x0285cbac258bf266, "1979-01-03 21:00:08.800000"},
{0x0285cbad27ae14e6, "1979-01-03 21:01:09.300001"},
{0x037969f722a53488, "2008-10-24 05:11:08.120000"},
{0x03b84285d71c57dd, "2016-07-01 09:41:50.416574"},
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment