# Getting the date on which an event in a time-series (e.g., the minimum value) occurs

I want to get the time in a time series that a particular event (e.g., the minimum value) occurs. The approach I take below seems clumsy. Is there a better way?

ts = TimeSeries[FinancialData["GE", "Jan. 1, 2007"]];
DateListPlot[ts]


6.66 = Min[ts]
p = Position[ts["Values"], Min[ts]][[1, 1]];
ts["DatePath"][[p]]

{DateObject[{2009, 3, 5, 0, 0, 0.}], 6.66}


## 1 Answer

A few other versions, the first one being the cleanest in a sense that it combines operation of finding the minimum and extracting the date.

MinimalBy[Normal[ts], Last]

Cases[Normal[ts], {_, Min[ts]}]

Cases[ts["DatePath"], {_, Min[ts]}]

Extract[Normal[ts], Position[ts["Values"], Min[ts]]]

• Thanks, Vitaliy. I appreciate the different examples. I didn't know about Extract. – George Wolfe Nov 12 '17 at 14:53