I am looking for the simplest way to convert strings in form “Sat Oct 31 00:52:14 2015” into anything that ROOT can handle, e.g. the TDatime (I will need to store pairs of such time-stamps, “start” and “stop”, in a tree and then analyse their differences).
presently the simplest solution would be to parse the string and use this constructor. To analyse the string, you can start from this:
TString myString ("Sat Oct 31 00:52:14 2015") TString tok int from=0 while (myString.Tokenize(tok, from, "[: ]")) cout << tok << endl; /* Sat Oct 31 00 52 14 2015 */