Yahoo Finance timestamps

Using Amiquote to download ^GSPC data with the Yahoo Finance workaround from this week the dates are misaligned with the actual date.

If I select 4 OCT 2024 to 10 OCT 2024 I should get data for 4,7,8,9 OCT but instead it downloads as per screenshot. Does anyone know why?

What time zone are you living in?

The problem might be the time difference between Yahoo servers and your timezone.

Australia. GMT+10:30 at the moment

So the timestamps you get might be because it is next day already in Australia when US Exchange closes.
Yahoo used to use the date in string format and they now use so called "Unix" time. The "Unix" time is number of seconds since January 1st, 1970. For human readable date as string it needs to be converted. Conversion involves your local time zone and it might be the cause of the problem.

What you might try is to:

  1. Open AmiQuote
  2. Click "Edit" button when "Yahoo Finance Workaround" is selected as data source
  3. Switch to "Javascript" tab
  4. Change the following lines:
                row += date.getFullYear() + "-" + 
                            zeroPad(date.getMonth()+1) + "-" + 
                            zeroPad(date.getDate()) + ", ";

to

                row += date.getUTCFullYear() + "-" + 
                            zeroPad(date.getUTCMonth()+1) + "-" + 
                            zeroPad(date.getUTCDate()) + ", ";
  1. Click OK
  2. Click "Download" to download again
  3. Examine dates

This should use UTC timezone instead of local. Please report back if it helps.

4 Likes

Yes this corrects the issue.

Thank you so much for your help!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.