Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Chromium timestamps are wrong #240

Open
stevenlele opened this issue Aug 15, 2023 · 0 comments
Open

Bug: Chromium timestamps are wrong #240

stevenlele opened this issue Aug 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@stevenlele
Copy link
Contributor

stevenlele commented Aug 15, 2023

The start time should be 1601/1/1 00:00 UTC instead of local time, so all timestamps are 8 hours early if you are in UTC+8 timezone.

On macOS, the timestamps are 8h 5m 43s 0ms early in UTC+8 timezone. Didn't figure out the cause.

Should just do epoch -= 11644473600000000.

func TimeEpoch(epoch int64) time.Time {
maxTime := int64(99633311740000000)
if epoch > maxTime {
return time.Date(2049, 1, 1, 1, 1, 1, 1, time.Local)
}
t := time.Date(1601, 1, 1, 0, 0, 0, 0, time.Local)
d := time.Duration(epoch)
for i := 0; i < 1000; i++ {
t = t.Add(d)
}
return t
}

Note: the timestamp was correct pre-v0.4.x:

func TimeEpochFormat(epoch int64) time.Time {
maxTime := int64(99633311740000000)
if epoch > maxTime {
return time.Date(2049, 1, 1, 1, 1, 1, 1, time.Local)
}
t := time.Date(1601, 1, 1, 0, 0, 0, 0, time.UTC)
d := time.Duration(epoch)
for i := 0; i < 1000; i++ {
t = t.Add(d)
}
return t
}

To identify export data generated pre-v0.4.x, the format was "...Z" instead of "...+08:00".

@stevenlele stevenlele added the bug Something isn't working label Aug 15, 2023
@moonD4rk moonD4rk changed the title Chromium timestamps are wrong Bug: Chromium timestamps are wrong Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant