File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
211
211
-i " pandas.Timestamp.fold GL08" \
212
212
-i " pandas.Timestamp.fromordinal SA01" \
213
213
-i " pandas.Timestamp.fromtimestamp PR01,SA01" \
214
- -i " pandas.Timestamp.hour GL08" \
215
214
-i " pandas.Timestamp.max PR02" \
216
215
-i " pandas.Timestamp.microsecond GL08" \
217
216
-i " pandas.Timestamp.min PR02" \
Original file line number Diff line number Diff line change @@ -590,6 +590,36 @@ cdef class _Timestamp(ABCTimestamp):
590
590
field, freq_name, month_kw, self ._creso)
591
591
return out[0 ]
592
592
593
+ def hour (self ) -> int:
594
+ """
595
+ Returns the hour component of the timestamp.
596
+
597
+ Extended Summary
598
+ --------
599
+ The hour is represented as an integer ranging from 0 to 23, where 0 corresponds
600
+ to midnight (00:00) and 23 corresponds to the last hour of the day (23:00).
601
+
602
+ Returns
603
+ --------
604
+ int
605
+ The hour component of the timestamp as an integer between 0 and 23.
606
+
607
+ See Also
608
+ --------
609
+ Timestamp.minute : Similar property indicating the minute of the timestamp.
610
+
611
+ Examples
612
+ --------
613
+ >>> ts = pd.Timestamp(' 2020-03-14T12:32:52.192548651' )
614
+ >>> ts.hour()
615
+ 12
616
+
617
+ >>> ts = pd.Timestamp(' 2020-03-14T22:43:12.192547851' )
618
+ >>> ts.hour()
619
+ 22
620
+ """
621
+ return self.hour
622
+
593
623
@property
594
624
def is_month_start(self ) -> bool:
595
625
"""
You can’t perform that action at this time.
0 commit comments