Generating 15 minute time interval array in python
<p>I am new to python. I am trying to generate time interval array. for example:
<code>
time_array = 
["2016-09-02T17:30:00Z", "2016-09-02T17:45:00Z", "2016-09-02T18:00:00Z", "2016-09-02T18:15:00Z", "2016-09-02T18:30:00Z", "2016-09-02T18:45:00Z"]
</code>
1. It should create the element like above in zulu time till 9 pm everyday.
2. Should generate the elements for next and day after next as well
3. Start time from 7:00 am - Ed time 9:00 pm,
if current_time is > start_time then generate 15 min time interval array till 9 pm. and then generate for next day and day + 2.
And Interval should be 7:00, 7:15 like that.. not in 7:12, 8:32</p>

<p>Looking at the data file, you should use the built in python date-time objects. followed by <code>strftime</code> to format your dates. </p>

<p>Broadly you can modify the code below to however many date-times you would like
First create a starting date. </p>

<pre><code>Today= datetime.datetime.today()
</code></pre>

<p>Replace 100 with whatever number of time intervals you want.    </p>

<pre><code>date_list = [Today + datetime.timedelta(minutes=15*x) for x in range(0, 100)]
</code></pre>

<p>Finally, format the list in the way that you would like, using code like that below. </p>

<pre><code>datetext=[x.strftime('%Y-%m-%d T%H:%M Z') for x in date_list]
</code></pre>

python arrays python-2.7