Merge pull request #18 from jryd/issue-12

Remove unused UnixMicro and UnixMilli functions
This commit is contained in:
jeffreydwalter 2019-03-30 09:17:44 -05:00 committed by GitHub
commit 0025c270c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
util.go
View File

@ -119,22 +119,6 @@ func (a *Arlo) DownloadFile(url string, w io.Writer) error {
return nil return nil
} }
func UnixMicro(t time.Time) int64 {
ns := t.UnixNano()
if ns < 0 {
return (ns - 999) / 1000
}
return ns / 1000
}
func UnixMilli(t time.Time) int64 {
ns := t.UnixNano()
if ns < 0 {
return (ns - 999999) / 1000000
}
return ns / 1000000
}
func FromUnixMicro(µs int64) time.Time { return time.Unix(0, 1000*µs) } func FromUnixMicro(µs int64) time.Time { return time.Unix(0, 1000*µs) }
func FromUnixMilli(ms int64) time.Time { return time.Unix(0, 1000000*ms) } func FromUnixMilli(ms int64) time.Time { return time.Unix(0, 1000000*ms) }