Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.04 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.04 KB

go-jdn

go-jdn is the tool of Julian Day Number.

GoDoc Go Report Card Build Status Coverage Status

Installation

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

Usage

package main

import (
  "fmt"
  "time"

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

func main() {
  t1 := time.Date(2018, 4, 13, 0, 0, 0, 0, time.UTC)
  fmt.Printf("%v", jdn.ToNumber(t1))
  // Output: 2458222

  t2 := JDN(2448046).ToTime()
  fmt.Printf("%v %v %v\n", t2.Year(), t2.Month(), t2.Day())
  // Output: 1990 June 3
}

More Info