Zemanim issue ?
Closed this issue · 1 comments
hi wrote the following code:
import {HebrewCalendar, months, HDate, Location, Event, ParshaEvent, Zmanim} from '@hebcal/core';
const loc = Location.lookup('Jerusalem');
const wed = new Date(2023,9,20);
const zeman = new Zmanim( wed, loc.getLatitude(), loc.getLongitude());
console.log("sunrise:" + zeman.sunrise())
console.log("sunset:" + zeman.sunset())
the output i'm getting is :
sunrise:Fri Oct 20 2023 06:45:38 GMT+0300 (Israel Daylight Time)
sunset:Fri Oct 20 2023 18:01:50 GMT+0300 (Israel Daylight Time)
it's writing "Fri" as for Friday instead of Wednesday
also, it's outputting GMT+0300 instead of +2
also it's outputting "Oct" instead of September
what am i doing wrong ?
if i send in the Date (2023 , 8 , 20) then it will get the right resualts (meaning you are still using based on 0-11 months
but still the GMT is wrong
As you noted, new Date(2023,9,20)
indeed is Friday October 20. For Wednesday September 20, you will need to use new Date(2023,8,20)
. This is not related to the Hebcal library, but rather standard JavaScript Date object
year
Integer value representing the year. Values from 0 to 99 map to the years 1900 to 1999. All other values are the actual year. See the example.
monthIndex
Integer value representing the month, beginning with 0 for January to 11 for December.
day Optional
Integer value representing the day of the month. Defaults to 1.
Separately, GMT +3 is the correct offset for Israel between the dates Fri, Mar 24, 2023 – Sun, Oct 29, 2023