Skip to content

DestinyLab/go-leapsecond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-leapsecond

go-leapsecond is the tool of leap seconds.

GoDoc Go Report Card Build Status Coverage Status

Installation

go get -u github.com/DestinyLab/go-leapsecond

Usage

package main

import (
  "fmt"
  "time"

  "github.com/DestinyLab/go-leapsecond"
)

func main() {
  t1 := time.Date(2017, 10, 1, 0, 0, 0, 0, time.UTC)
  fmt.Printf("%v", leapsecond.Have(t1))
  // Output: 27s

  t2 := time.Date(2010, 12, 1, 0, 0, 0, 0, time.UTC)
  fmt.Printf("%v", leapsecond.Diff(t1, t2))
  // Output: 3s
}

More Info

About

go-leapsecond is the tool of leap seconds.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages