Feature request: get market calendar in various timezones
See original GitHub issueI think it would be nice to have the option in get_calendar()
to specify a timezone you want the calendar in. Here is some code I’ve written recently to do this:
def get_eastern_market_open_close():
ny = pytz.timezone('America/New_York')
today_ny = datetime.datetime.now(ny)
ndq = mcal.get_calendar('NASDAQ')
open_days = ndq.schedule(start_date=today_ny - pd.Timedelta(str(3*365) + ' days'),
end_date=today_ny)
# convert times to eastern
for m in ['market_open', 'market_close']:
open_days[m] = open_days[m].dt.tz_convert('America/New_York')
return open_days
I’d be happy to implement this, I don’t see any guidelines on collaborating though. Am I good to just code it and issue a pull request?
Not sure if it’s better suited in get_calendar
or .schedule
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Multiple Time Zones - Business Calendar Customer Support
Multiple Time Zones. I am surprised that none of the views features additional time zones, similar to MS Outlook or Google Calendar.
Read more >Multiple Timezones in Teams Calendar
Has Microsoft given additional consideration to the request to add multiple timezones to the Teams Calendar, similar to the functionality to ...
Read more >Traveling and Keeping Your Calendar Appointments In the ...
As you're preparing for an upcoming trip you go through your calendar to make sure that all of your appointments are still in...
Read more >How to handle calendar TimeZones using Java?
Get TimeZone of user TimeZone currentTimeZone = sc_.getTimeZone(); Calendar currentDt = new GregorianCalendar(currentTimeZone, EN_US_LOCALE); // Get the ...
Read more >How to Schedule Meetings in Different Time Zones (and see ...
If you are NOT using Office 365 or Exchange Server: You won't be able to access the full functionality described above but you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for this suggestion. In terms of collaborating I am open and welcoming to all, I just ask that you submit a PR and including tests so that we can make sure in the future any feature you add continues to work with others new PRs.
For this change, I think it makes the most sense to add the “time_zone” as a parameter in the schedule() function and do the conversation there. I think that all the internals should be kept in UTC and the conversation to any specific time zone done at the end point. This will make code maintenance easier.
This is now merged into master from #106 Thanks.