@@ -700,6 +700,9 @@ class Timestamp(_Timestamp):
700
700
elif tz is not None :
701
701
raise ValueError (' Can provide at most one of tz, tzinfo' )
702
702
703
+ # User passed tzinfo instead of tz; avoid silently ignoring
704
+ tz, tzinfo = tzinfo, None
705
+
703
706
if is_string_object(ts_input):
704
707
# User passed a date string to parse.
705
708
# Check that the user didn't also pass a date attribute kwarg.
@@ -709,21 +712,18 @@ class Timestamp(_Timestamp):
709
712
710
713
elif ts_input is _no_input:
711
714
# User passed keyword arguments.
712
- return Timestamp(datetime(year, month, day, hour or 0 ,
713
- minute or 0 , second or 0 ,
714
- microsecond or 0 , tzinfo),
715
- nanosecond = nanosecond, tz = tz)
715
+ ts_input = datetime(year, month, day, hour or 0 ,
716
+ minute or 0 , second or 0 ,
717
+ microsecond or 0 )
716
718
elif is_integer_object(freq):
717
719
# User passed positional arguments:
718
720
# Timestamp(year, month, day[, hour[, minute[, second[,
719
721
# microsecond[, nanosecond[, tzinfo]]]]]])
720
- return Timestamp(datetime(ts_input, freq, tz, unit or 0 ,
721
- year or 0 , month or 0 , day or 0 ,
722
- minute), nanosecond = hour)
723
-
724
- if tzinfo is not None :
725
- # User passed tzinfo instead of tz; avoid silently ignoring
726
- tz, tzinfo = tzinfo, None
722
+ ts_input = datetime(ts_input, freq, tz, unit or 0 ,
723
+ year or 0 , month or 0 , day or 0 )
724
+ nanosecond = hour
725
+ tz = minute
726
+ freq = None
727
727
728
728
if getattr (ts_input, ' tzinfo' , None ) is not None and tz is not None :
729
729
warnings.warn(" Passing a datetime or Timestamp with tzinfo and the"
0 commit comments