Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How can I get the date?

I want to purchase SPY on 15th January 2017.
How can I write this in quantopian?
Below the code for your reference.

Thank you.

today = get_datetime('US/Eastern')
if today.date = 15/01/2017: <--- Not sure about this part
order_target_percent(context.SPY, 1)

2 responses
import datetime  
if today.date() == datetime.date(2017,1,15):  
    order_target_percent(context.SPY, 1)  

Thank you !!!