Skip to content

Commit 53bb629

Browse files
author
Shlomi Kushchi
authored
another way to format the date for historic_agg_v2
1 parent d8a1ae1 commit 53bb629

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,11 @@ and here's a minute example usage:
309309
import pytz
310310
NY = 'America/New_York'
311311

312-
start=pytz.timezone(NY).localize(datetime(2020,1,2,9,30)).timestamp()*1000 # timestamp in micro seconds
313-
end=pytz.timezone(NY).localize(datetime(2020,1,2,16,0)).timestamp()*1000
314-
df=api.polygon.historic_agg_v2('AAPL', 1, 'minute', _from=start, to=end).df
312+
start = pytz.timezone(NY).localize(datetime(2020,1,2,9,30)).timestamp()*1000 # timestamp in micro seconds
313+
# another alternative will be: start = pd.Timestamp('2020-01-02 09:30', tz=NY).value/1e6
314+
end = pytz.timezone(NY).localize(datetime(2020,1,2,16,0)).timestamp()*1000
315+
df = api.polygon.historic_agg_v2('AAPL', 1, 'minute', _from=start, to=end).df
316+
315317
```
316318

317319
## polygon/REST

0 commit comments

Comments
 (0)