# example for year only. just lead with int. no astype needed. int(pd.Timestamp.today().strftime('%Y')) # 2022