C# (CSharp) Zmanim Namespace

Nested Namespaces

Zmanim.HebrewCalendar

Classes

Name Description
ComplexZmanimCalendar This class extends ZmanimCalendar and provides many more zmanim than available in the ZmanimCalendar. The basis for most zmanim in this class are from the sefer Yisroel Vehazmanim by Rabbi Yisroel Dovid Harfenes.
For an example of the number of different zmanim made available by this class, there are methods to return 12 different calculations for alos (dawn) available in this class. The real power of this API is the ease in calculating zmanim that are not part of the API. The methods for doing zmanim calculations not present in this or it's superclass the ZmanimCalendar are contained in the AstronomicalCalendar, the base class of the calendars in our API since they are generic methods for calculating time based on degrees or time before or after sunrise" and sunset and are of interest for calculation beyond zmanim calculations. Here are some examples:
First create the Calendar for the location you would like to calculate: string locationName = "Lakewood, NJ" double latitude = 40.0828; //Lakewood, NJ double longitude = -74.2094; //Lakewood, NJ double elevation = 0; ITimeZone timeZone = new JavaTimeZone("America/New_York"); GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); ComplexZmanimCalendar czc = new ComplexZmanimCalendar(DateTime.Now, location); Note: For locations such as Israel where the beginning and end of daylight savings time can fluctuate from year to year create a Zmanim.TimeZone.ITimeZone with the known start and end of DST.
To get alos calculated as 14° below the horizon (as calculated in the calendars published in Montreal) use: DateTime alos14 = czc.getSunriseOffsetByDegrees(14); To get mincha gedola calculated based on the MGA using a shaah zmanis based on the day starting 16.1° below the horizon (and ending 16.1° after sunset the following calculation can be used: DateTime minchaGedola = czc.getTimeOffset(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees() * 6.5); A little more complex example would be calculating plag hamincha based on a shaah zmanis that was not present in this class. While a drop more complex it is still rather easy. For example if you wanted to calculate plag based on the day starting 12° before sunrise and ending 12° after sunset as calculated in the calendars in Manchester, England (there is nothing that would prevent your calculating the day using sunrise and sunset offsets that are not identical degrees, but this would lead to chatzos being a time other than the solar transit (solar midday)). The steps involved would be to first calculate the shaah zmanis and than use that time in milliseconds to calculate 10.75 hours after sunrise starting at 12° before sunset long shaahZmanis = czc.getTemporalHour(czc.getSunriseOffsetByDegrees(12), czc.getSunsetOffsetByDegrees(12)); DateTime plag = getTimeOffset(czc.getSunriseOffsetByDegrees(12), shaahZmanis * 10.75);

Disclaimer:

While I did my best to get accurate results please do not rely on these zmanim for halacha lemaaseh