Is it necessary to sort time series data on datetime stamps?
Sorting data won't affect the training of your model, it is similar to changing the random seed.

It can affect the validation that you are doing. In case you do time series you can do sliding window or roll-out-window, that they need the data to be sorted before the splitting.

It seems that you want to do time series regression with supervised learning so what you probably want to do is change your problem to a supervised learning problem. You can see a bit more here. But this is me guessing what you wnat from a couple lines.