title: Converting pandas dataframe to datetime
body: <p>I have a Pandas dataframe of which each column specifies an element of a datetime (year, month, day, etc.) in integer format. I want to join these separate columns into a single datetime object, which according to <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_datetime.html" rel="nofollow noreferrer">the documentation</a> is a legal operation. But after one frustrating hour I haven't yet figured out how to do this. See for instance this minimal example:</p>
  
  <pre><code>import pandas as pd
  
  df = pd.DataFrame(
      [[2011, 5, 3], [2014, 9, 13], [2022, 1, 1]],
      columns=("year", "month", "day")
  )
  
  datetime = df.apply(pd.to_datetime)
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>0 2011-05-03
  1 2014-09-13
  2 2022-01-01
  </code></pre>
  
  <p>Actual result:</p>
  
  <pre><code>                           year              ...                                        day
  0 1970-01-01 00:00:00.000002011              ...              1970-01-01 00:00:00.000000003
  1 1970-01-01 00:00:00.000002014              ...              1970-01-01 00:00:00.000000013
  2 1970-01-01 00:00:00.000002022              ...              1970-01-01 00:00:00.000000001
  </code></pre>
  
  <p>Any suggestions?</p>