gadicc / node-yahoo-finance2

Unofficial API for Yahoo Finance
https://www.npmjs.com/package/yahoo-finance2
MIT License
353 stars 58 forks source link

Incorrect dates in historical data #758

Open pateldhruv1993 opened 3 months ago

pateldhruv1993 commented 3 months ago

Bug Report

Describe the bug

Hey!

So when I try to get historical data for a ticket (QQQ),  the date in my data seems to be off by 1. The 'Sundays' shown in screenshot below are actually Mondays. The timezone is EST on that date object so not sure why the dates are off.

Minimal Reproduction

This is the code I'm using. I also tried with Apple's ticker and same things happens. let data = await yahooFinance.historical(symbol, { period1: fromDate, period2: toDate, interval: interval, // allowedValues: [ '1d', '1wk', '1mo' ] });

Environment

Browser or Node: Node.js Node version (if applicable): v20.11.1 Npm version: 10.2.4 Browser verion (if applicable): Library version (e.g. 1.10.1):

Additional Context

Screenshot 2024-03-26 234512