<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [2]: ts = 1.4884427244831782e+18

In [3]: pd.to_datetime(ts, utc=True)
Out[3]: Timestamp('2017-03-02 08:18:44.483178240+0000', tz='UTC')

In [4]: pd.to_datetime([ts], utc=True)
Out[4]: DatetimeIndex(['2017-03-02 08:18:44.483178240+00:00'], dtype='datetime64[ns, UTC]', freq=None)

In [5]: pd.to_datetime(pd.Series([ts]), utc=True)
Out[5]: 
0   2017-03-02 08:18:44.483178240
dtype: datetime64[ns]"><pre class="notranslate"><span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">2</span><span class="pl-kos">]</span>: <span class="pl-s1">ts</span> <span class="pl-c1">=</span> <span class="pl-c1">1.4884427244831782e+18</span>

<span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-s1">ts</span><span class="pl-kos">,</span> <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-v">True</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">]</span>: <span class="pl-v">Timestamp</span><span class="pl-kos">(</span><span class="pl-s">'2017-03-02 08:18:44.483178240+0000'</span><span class="pl-kos">,</span> <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'UTC'</span><span class="pl-kos">)</span>

<span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">4</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">ts</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-v">True</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">4</span><span class="pl-kos">]</span>: <span class="pl-v">DatetimeIndex</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'2017-03-02 08:18:44.483178240+00:00'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'datetime64[ns, UTC]'</span><span class="pl-kos">,</span> <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-v">None</span><span class="pl-kos">)</span>

<span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">Series</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">ts</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-v">True</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span>: 
<span class="pl-c1">0</span>   <span class="pl-c1">2017</span><span class="pl-c1">-</span><span class="pl-c1">03</span><span class="pl-c1">-</span><span class="pl-c1">02</span> <span class="pl-c1">08</span>:<span class="pl-c1">18</span>:<span class="pl-c1">44.483178240</span>
dtype: <span class="pl-s1">datetime64</span><span class="pl-kos">[</span><span class="pl-s1">ns</span><span class="pl-kos">]</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">The argument <code class="notranslate">utc=True</code> in function <code class="notranslate">to_datetime</code> is not working when passing a <code class="notranslate">Series</code>, differently from other case, e.g. when passing a list or a scalar Unix timestamp.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">The expected output is the same as the one given by</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [6]: pd.to_datetime(pd.Series([ts])).dt.tz_localize('UTC')
Out[6]: 
0   2017-03-02 08:18:44.483178240+00:00
dtype: datetime64[ns, UTC]"><pre class="notranslate"><span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">6</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">Series</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">ts</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dt</span><span class="pl-kos">.</span><span class="pl-en">tz_localize</span><span class="pl-kos">(</span><span class="pl-s">'UTC'</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">6</span><span class="pl-kos">]</span>: 
<span class="pl-c1">0</span>   <span class="pl-c1">2017</span><span class="pl-c1">-</span><span class="pl-c1">03</span><span class="pl-c1">-</span><span class="pl-c1">02</span> <span class="pl-c1">08</span>:<span class="pl-c1">18</span>:<span class="pl-c1">44.483178240</span><span class="pl-c1">+</span><span class="pl-c1">00</span>:<span class="pl-c1">00</span>
dtype: <span class="pl-s1">datetime64</span><span class="pl-kos">[</span><span class="pl-s1">ns</span><span class="pl-kos">,</span> <span class="pl-c1">UTC</span><span class="pl-kos">]</span></pre></div>
<h4 dir="auto">Another example: <code class="notranslate">tz_convert</code></h4>
<p dir="auto">It is straightforward to convert to another time zone from a Unix timestamp or list:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [7]: pd.to_datetime(ts, utc=True).tz_convert('Europe/Paris')
Out[7]: Timestamp('2017-03-02 09:18:44.483178240+0100', tz='Europe/Paris')

In [8]: pd.to_datetime([ts], utc=True).tz_convert('Europe/Paris')
Out[8]: DatetimeIndex(['2017-03-02 09:18:44.483178240+01:00'], dtype='datetime64[ns, Europe/Paris]', freq=None)"><pre class="notranslate"><span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">7</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-s1">ts</span><span class="pl-kos">,</span> <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-v">True</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">tz_convert</span><span class="pl-kos">(</span><span class="pl-s">'Europe/Paris'</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">7</span><span class="pl-kos">]</span>: <span class="pl-v">Timestamp</span><span class="pl-kos">(</span><span class="pl-s">'2017-03-02 09:18:44.483178240+0100'</span><span class="pl-kos">,</span> <span class="pl-s1">tz</span><span class="pl-c1">=</span><span class="pl-s">'Europe/Paris'</span><span class="pl-kos">)</span>

<span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">8</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">ts</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-v">True</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">tz_convert</span><span class="pl-kos">(</span><span class="pl-s">'Europe/Paris'</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">8</span><span class="pl-kos">]</span>: <span class="pl-v">DatetimeIndex</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'2017-03-02 09:18:44.483178240+01:00'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">dtype</span><span class="pl-c1">=</span><span class="pl-s">'datetime64[ns, Europe/Paris]'</span><span class="pl-kos">,</span> <span class="pl-s1">freq</span><span class="pl-c1">=</span><span class="pl-v">None</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">whereas for a <code class="notranslate">Series</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In [9]: pd.to_datetime(pd.Series([ts])).dt.tz_localize('UTC').dt.tz_convert('Europe/Paris')
Out[9]: 
0   2017-03-02 09:18:44.483178240+01:00
dtype: datetime64[ns, Europe/Paris]"><pre class="notranslate"><span class="pl-v">In</span> <span class="pl-kos">[</span><span class="pl-c1">9</span><span class="pl-kos">]</span>: <span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">to_datetime</span><span class="pl-kos">(</span><span class="pl-s1">pd</span><span class="pl-kos">.</span><span class="pl-en">Series</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">ts</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dt</span><span class="pl-kos">.</span><span class="pl-en">tz_localize</span><span class="pl-kos">(</span><span class="pl-s">'UTC'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dt</span><span class="pl-kos">.</span><span class="pl-en">tz_convert</span><span class="pl-kos">(</span><span class="pl-s">'Europe/Paris'</span><span class="pl-kos">)</span>
<span class="pl-v">Out</span><span class="pl-kos">[</span><span class="pl-c1">9</span><span class="pl-kos">]</span>: 
<span class="pl-c1">0</span>   <span class="pl-c1">2017</span><span class="pl-c1">-</span><span class="pl-c1">03</span><span class="pl-c1">-</span><span class="pl-c1">02</span> <span class="pl-c1">09</span>:<span class="pl-c1">18</span>:<span class="pl-c1">44.483178240</span><span class="pl-c1">+</span><span class="pl-c1">01</span>:<span class="pl-c1">00</span>
dtype: <span class="pl-s1">datetime64</span><span class="pl-kos">[</span><span class="pl-s1">ns</span><span class="pl-kos">,</span> <span class="pl-v">Europe</span><span class="pl-c1">/</span><span class="pl-v">Paris</span><span class="pl-kos">]</span></pre></div>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-113-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: ca_ES.UTF-8
LOCALE: ca_ES.UTF-8
<p dir="auto">pandas: 0.19.2<br>
nose: 1.3.7<br>
pip: 8.1.2<br>
setuptools: 27.2.0.post20161106<br>
Cython: 0.24.1<br>
numpy: 1.11.1<br>
scipy: 0.18.1<br>
statsmodels: 0.6.1<br>
xarray: None<br>
IPython: 5.1.0<br>
sphinx: 1.4.6<br>
patsy: 0.4.1<br>
dateutil: 2.5.3<br>
pytz: 2016.6.1<br>
blosc: None<br>
bottleneck: 1.1.0<br>
tables: 3.2.3.1<br>
numexpr: 2.6.1<br>
matplotlib: 1.5.3<br>
openpyxl: 2.3.2<br>
xlrd: 1.0.0<br>
xlwt: 1.1.2<br>
xlsxwriter: 0.9.3<br>
lxml: 3.6.4<br>
bs4: 4.5.1<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: 1.0.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: 2.42.0<br>
pandas_datareader: 0.2.1</p>
</details>
<p dir="auto">Is this a bug or a feature that I don't understand:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="data = ['20100102 121314', '20100102 121315']
print (pd.to_datetime(data, format='%Y%m%d %H%M%S', 
                      utc=True)[0]).__repr__()
print (pd.to_datetime(pd.Series(data), format='%Y%m%d %H%M%S', 
                      utc=True)[0]).__repr__()
print (pd.to_datetime(pd.TimeSeries(data), format='%Y%m%d %H%M%S', 
                     utc=True)[0]).__repr__()"><pre class="notranslate"><span class="pl-s1">data</span> <span class="pl-c1">=</span> [<span class="pl-s">'20100102 121314'</span>, <span class="pl-s">'20100102 121315'</span>]
<span class="pl-en">print</span> (<span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">data</span>, <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'%Y%m%d %H%M%S'</span>, 
                      <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)[<span class="pl-c1">0</span>]).<span class="pl-en">__repr__</span>()
<span class="pl-en">print</span> (<span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">data</span>), <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'%Y%m%d %H%M%S'</span>, 
                      <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)[<span class="pl-c1">0</span>]).<span class="pl-en">__repr__</span>()
<span class="pl-en">print</span> (<span class="pl-s1">pd</span>.<span class="pl-en">to_datetime</span>(<span class="pl-s1">pd</span>.<span class="pl-v">TimeSeries</span>(<span class="pl-s1">data</span>), <span class="pl-s1">format</span><span class="pl-c1">=</span><span class="pl-s">'%Y%m%d %H%M%S'</span>, 
                     <span class="pl-s1">utc</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)[<span class="pl-c1">0</span>]).<span class="pl-en">__repr__</span>()</pre></div>
<p dir="auto">results in</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Timestamp('2010-01-02 12:13:14+0000', tz='UTC')
Timestamp('2010-01-02 12:13:14', tz=None)
Timestamp('2010-01-02 12:13:14', tz=None)"><pre class="notranslate">Timestamp(<span class="pl-s"><span class="pl-pds">'</span>2010-01-02 12:13:14+0000<span class="pl-pds">'</span></span>, tz=<span class="pl-s"><span class="pl-pds">'</span>UTC<span class="pl-pds">'</span></span>)
Timestamp(<span class="pl-s"><span class="pl-pds">'</span>2010-01-02 12:13:14<span class="pl-pds">'</span></span>, tz=None)
Timestamp(<span class="pl-s"><span class="pl-pds">'</span>2010-01-02 12:13:14<span class="pl-pds">'</span></span>, tz=None)</pre></div>
<p dir="auto">Using version '0.13.1'</p>
<hr>
<p dir="auto">Other example in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="215639085" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/15760" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/15760/hovercard" href="https://github.com/pandas-dev/pandas/issues/15760">#15760</a></p>