Skip to main content
`Ctrl`+`K`

# pandas.Period.hour

Period.hour

  Get the hour of the day component of the Period.

  For periods with a frequency shorter than a day, this returns the hour portion of the time. For longer frequencies, it returns 0.

  Returns:
    int

      The hour as an integer, between 0 and 23.

  See also

  `Period.second`

    Get the second component of the Period.

  `Period.minute`

    Get the minute component of the Period.

  Examples

      >>> p = pd.Period("2018-03-11 13:03:12.050000")
      >>> p.hour
      13

  Period longer than a day

      >>> p = pd.Period("2018-03-11", freq="M")
      >>> p.hour
      0