time.strftime() not updaing
<p>I am trying to get the time when a button is pushed, but I am going to have a few pushes without starting and calling the time module. In Ipython, I tested out some code, and the time is not updating</p>

<pre><code>import time
t = time.strftime("%b-%d-%y at %I:%m%p")
print(t)
#do something else for a little
t = time.strftime("%b-%d-%y at %I:%m%p")
print(t)
</code></pre>

<p>It gives me the same time</p>

<p>even if I put in a time tuple such as:</p>

<pre><code>lt = time.localtime(time.time())
t = time.strftime("%b-%d-%y at %I:%m%p", lt)
print(t)
</code></pre>

<p>I get the same time</p>

<p>Even if I wait, and execute the code again (in Ipython), it gives me the same time. </p>

<p>time.time() will give me a new time every time though</p>

<p>I don't know if doing it in Ipython (I'm just testing code before I put it in my python file) matters</p>

<p>What am I doing wrong??</p>

<p>You are using <code>%m</code> at <code>%I:%m%p</code> to format your "minutes", which actually means a <strong>month</strong> in decimals. Try capital <code>%M</code>instead to get the minutes.</p>

<p>So,</p>

<pre><code>time.strftime("%b-%d-%y at %I:%M%p")
</code></pre>

<p>See <a href="https://docs.python.org/2/library/time.html#time.strftime" rel="nofollow">strftime documentation</a> for the format directives.</p>

python time module