Set day, month and year of a python time_struct without changing the time
Question: How can I set day, month, and year of a python time_struct without changing
the time which is already in.

The time is specified by the user and assumed to be a time of the current day.
This code converts the given string to a time_struct, but sets the date to
1/1/1900:

    
    
    from time import strptime
    self._alarmTime = strptime(self._frame.txtAlarmTime.text(), '%H:%M:%S')
    

I now want to replace this 1/1/1900 with some kind of `today()`.

It sounds simple, but I have no idea at the moment.


Answer: You could also use datetime module:

    
    
    from datetime import datetime
    
    datetime.combine( datetime.today().date(),
                      datetime.strptime('23:46:00', '%H:%M:%S').time()
                    )
    

