- Notifications
You must be signed in to change notification settings - Fork8
C library for zmanim & hebrew calendar
License
yparitcher/libzmanim
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
a C library for zmanim and hebrew dates
a port ofKosherJava/Zmanim developed by Eliyahu Hershfeld.https://kosherjava.com
run make
to build the library (shared and static) in the lib folder.
runmake test
to build a test wrapper (in the test folder) to display the daily zmanim.
this creates a shared and static library that can be used by including the header files ininclude
and linking with-lzmanim
(you must add the library and headers to yourPATH
)
run window.bat in a VisualStudio command prompt to buildlibzmanim.dll
andtest.exe
. This uses the OpenBSD stpncpy.
this library has a new structhdate
which is likestruct tm
used to store a date instance in the hebrew calendar.
one can initialize the members directly or use thehdate convertDate(struct tm date)
function to convert a gregorian date, along with other functions inhebrewcalendar.c
to manipulate it or get yomtov parshah etc.
for more documentation read the header files.
to format the date in hebrew use the functions inhdateformat.h
.
one can then use thishdate
along with thelocation
struct (lat, long, elevation) in one of the getzmanim functions inzmanim.h
that return ahdate
with the correct zman.
for further examples see the test.c file that implements a basic wrapper to show daily zmanim
./test year month day latitude longitude timezone Eretz_Yisroel
./test 2018 12 18 40.66896 -73.94284 -4.0 0 י טבת תשע״ט עשרה בטבת פרשת ויחיalos: 05:41 AM ESTmisheyakir: 06:19 AM ESTsunrise: 07:14 AM ESTshma: 09:31 AM ESTtefila: 10:18 AM ESTchatzos: 11:52 AM ESTmincha gedola: 12:15 PM ESTmincha ketana: 02:37 PM ESTplag hamincha: 03:36 PM ESTsunset: 04:30 PM ESTtzais: 05:01 PM EST
note: due to the limitations of the C standard library all times will show as if they in the computers timezone even though they are correctly calculated in the given timezone.
Libzmanim is Copyright (c) 2018Yparitcher.licensed under theLGPL 2.1 license.
About
C library for zmanim & hebrew calendar