Toon Verstraelen
Toon Verstraelen

Reputation: 477

How is the date argument formatted in the euronext data download url?

I'd like to download historical stock prices from nyx.com with a script. The download URL has to following from:

https://europeanequities.nyx.com/nyx_eu_listings/price_chart/download_historical?typefile=csv&layout=vertical&typedate=dmy&separator=point&mic=XPAR&isin=FR0010557264&name=AB%20SCIENCE&namefile=Price_Data_Historical&from=1356998400000&to=1386115200000&adjusted=1&base=0

The format of most arguments is obvious, except for the "from" and "to" arguments, which determine the begin and end date of the historical prices. In this example, the begin date is January 1, 2013 and the end date is December 4, 2013. How are these dates transformed into numbers like 1356998400000 and 1386115200000?

P.S. I'd rather not use Yahoo finance due to the large amount of errors in the data, especially for the European Markets.

Upvotes: 0

Views: 560

Answers (1)

Shadow
Shadow

Reputation: 31

In case you are still interested by the answer : The numbers used for "to" and "from" fields are timestamps with respect to the millisecond and not to the second as usual.

Basicaly, this is the number of milli-seconds elapsed since January the first 1970 0h00m00s000 UTC.

For the first number, 1356998400000, you can truncate the last three 0 to convert it to a classic timestamp (remove milli-seconds part). Any timstamp convertor will map 1356998400 to 1/1/2013 1:00:00

For the second number, once truncated, 1386115200 converts to 12/04/2013 1:00:00

Hop it'll help and thanks for the link to nyx.com ! Was looking for something like that for a long time !

Upvotes: 3

Related Questions