Update: I orginally had a table called T with dates from 01/01/1987 00:00 to 01/01/2020 00:00 and I used the following script to group the dates into months and to find the mean of soil temperature for each month:
TT = groupsummary(T,1,"Month","Mean",38);
where 1 is the column number for the dates in T and 38 is the column number for soil temperature in T.
Then TT is my new table as mentioned in my original question post.