Forum Discussion
Anonymous
3 years agoNot applicable
Problem Updating URL with Unix Times
Hello all, I am currently making a dashboard that pulls stock prices from Yahoo Finance with an end date of the current day and a start date of 30 days prior. I have figured out how to create a f...
- 3 years ago
Please try this syntax. You need to convert your start and end to text to concat them with the rest of the url.
let StartDate = Number.Round(Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0))-2592000,0), EndDate = Number.Round(Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0)),0), Source = Web.Contents("https://finance.yahoo.com/quote/EEM/historyperiod1=" & Text.From(StartDate) & "&period2=" & Text.From(EndDate) & "&interval=1d&filter=history&frequency=1d&includeAdjustedClose=true") in SourcePat
mahoneypat
3 years agoMicrosoft Employee
Please try this syntax. You need to convert your start and end to text to concat them with the rest of the url.
let
StartDate = Number.Round(Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0))-2592000,0),
EndDate = Number.Round(Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0)),0),
Source = Web.Contents("https://finance.yahoo.com/quote/EEM/historyperiod1=" & Text.From(StartDate) & "&period2=" & Text.From(EndDate) & "&interval=1d&filter=history&frequency=1d&includeAdjustedClose=true")
in
Source
Pat
Anonymous
3 years agoNot applicable
Hello,
Thank you very much for your response! This was the solution!