seconds since midnight to datetime (python)
<p>I have a timezone aware datetime date object:</p>

<pre><code>Timestamp('2004-03-29 00:00:00-0456', tz='America/New_York')
</code></pre>

<p>and a number of mili seconds since midnight (midnight in the local timezone):</p>

<p>34188542</p>

<p>How to combine them to get a valid datetime?</p>

<p>Create a <a href="https://docs.python.org/2/library/datetime.html#timedelta-objects" rel="nofollow"><code>timedelta</code></a> object and add it to you time like this:</p>

<pre><code>td = datetime.timedelta(milliseconds=34188542)
date_object = datetime.datetime.now() + td  # change to your datetime object, I just use `now()`
</code></pre>

python datetime