title: Is there a way to get a local timestamp in my IPython prompt?
body: <p>Is there a way to get a local timestamp in my IPython prompt? I'm using IPython 0.10 and Python 2.6 on 64-bit Windows Vista.</p>
  
  <p>My current default prompt is</p>
  
  <pre><code>[C:Python26/Scripts]
  |9&gt;
  </code></pre>
  
  <hr>
  
  <p>OK, I tried to follow your directions exactly. However, my experience has been that all config editing is best kept to my <code>ipy_user_conf.py</code>. To quote from it:</p>
  
  <pre><code>User configuration file for IPython (ipy_user_conf.py)
  
  This is a more flexible and safe way to configure ipython than *rc files
  (ipythonrc, ipythonrc-pysh etc.)
  
  This file is always imported on ipython startup. You can import the
  ipython extensions you need here (see IPython/Extensions directory).
  
  Feel free to edit this file to customize your ipython experience.
  
  Note that as such this file does nothing, for backwards compatibility.
  Consult e.g. file 'ipy_profile_sh.py' for an example of the things 
  you can do here.
  
  See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
  description on what you could do here.
  </code></pre>
  
  <p>So I now have these lines in main():</p>
  
  <pre><code># -- prompt
  # A different, more compact set of prompts from the default ones, that
  # always show your current location in the filesystem:
  
  o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#&gt;'
  o.prompt_in2 = r'.\D: '
  o.prompt_out = r'[\#] '
  </code></pre>
  
  <p>And I get this, for an example:</p>
  
  <pre><code>16:49:50 In[9]:1/7
  1           [9] 0.14285714285714285
  
  16:50:09 In[10]:
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>What is that <code>1</code>?</li>
  <li><p>How can I keep the current directory in the prompt? Before, I had</p>
  
  <pre><code>[C:Python26/Scripts]
  |8&gt;
  </code></pre></li>
  </ol>
  
  <hr>
  
  <p>Once more with feeling.
  I'm so sorry for the mess I've made. I need to report the lines I either added or modified actually are:</p>
  
  <pre><code>import_all("os sys random datetime")
  o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#&gt;'
  o.prompt_in1 = r'${datetime.now().strftime("%H:%M:%S")}[\#]:'
  o.prompt_out = r'[\#] '
  </code></pre>