Easiest way to combine date and time strings to single datetime object using Python

后端 未结 4 1048
北恋
北恋 2020-12-13 15:59

I have a web form which has 2 input fields, \"StartDate\" and \"StartTime\". I convert the StartDate field\'s string into a Python datetime object

4条回答
  •  庸人自扰
    2020-12-13 16:09

    import datetime
    def time_tango(date, time):
        return datetime.datetime.combine(date, time)
    

提交回复
热议问题