Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Jewish dates conversion tool

License

NotificationsYou must be signed in to change notification settings

simolev/caleb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jewish dates conversion tool

Usage:

go get github.com/simolev/caleb

package mainimport ("fmt""github.com/simolev/caleb""time")funcmain() {j1:= caleb.JewishDate{Shana:5779,Chodesh:7,Yom:25}// 25 Adar II 5779g1:=caleb.JewishToGregorian(j1)//fmt.Println(j1,"=>",g1.Format("2006-01-02"))// 25 Adar II 5779 => 2019-04-01g2:=time.Date(2018,8,11,0,0,0,0,time.UTC)// 2018-08-11j2:=caleb.GregorianToJewish(g2)//fmt.Println(g2.Format("2006-01-02"),"=>",j2)// 2018-08-11 => 30 Av 5778}

Disclaimer:

a) It is not accurate for dates before Gregorian1582-10-15. In the Gregorian calendar, there are 10 missing days between 1582-10-15 and 1582-10-04. Those days never occurred, but nonetheless they seem to exist in go's implementation, and the only solution I see at the moment would be to add manual correction to the algorithm.

b) This is quite new and would require more thorough testing before being relied upon.

c) Code could be more idiomatic and optimized.

Credits:

Thanks toinfo@dafaweek.com.
Converted from #"http://www.dafaweek.com/HebCal/HebCalSampleSource.php" rel="nofollow">http://www.dafaweek.com/HebCal/HebCalSampleSource.php
See alsohttp://www.dafaweek.com/hebcal/hebcalvb6.php

About

Jewish dates conversion tool

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp