Skip to content

hebcal/hdate

Repository files navigation

hdate

Build Status Go Report Card GoDoc

Hebcal's hdate package converts between Hebrew and Gregorian dates.

It also includes functions for calculating personal anniversaries (Yahrzeit, Birthday) according to the Hebrew calendar.

Internally, it uses R.D. (Rata Die) day numbers.

Example

package main

import (
	"fmt"
	"time"

	"github.com/hebcal/hdate"
)

func main() {
	hd := hdate.New(5765, hdate.Adar2, 22)
	year, month, day := hd.Greg()
	fmt.Println(year, month, day)
	// Output: 2005 April 2

	hd2 := hdate.FromGregorian(2008, time.November, 13)
	fmt.Println(hd2)
	// Output: 15 Cheshvan 5769
}