Use
int.TryParse[
^] instead. You get a true/false value back from the method call telling you whether the parsing operation succeeded or not.
Now, you cannot convert an integer to a DateTime. It doesn't make any sense to do so.
You CAN, however, add hours, minutes, seconds, days, months, ...whatever to an existing date/time value but that has to have a starting date/time to work with, like you're already doing near the top of your code snippet.
In your code snippet, you can use the ts.Days value in a call to .AddDays() on some existing DateTime value.