Update
It turns out that there is a much simpler method than my previous answer. If you need the actual cell label value, than I think messing around with the CellLabelAutoDelete option is necessary. On the other hand, if you know what the CellLabel is, then Cells is perfectly capable of returning the corresponding Cell. So, the following is a simpler version:
cellTimes[n_Integer?Positive] := gmtAbsoluteTimeToString @ Max @ CurrentValue[
Cells[CellLabel -> "In["<>ToString[n]<>"]:="],
CellChangeTimes
]
gmtAbsoluteTimeToString[time_] := DateString @ TimeZoneConvert[
DateObject[time,TimeZone->0]
]
Original answer
You can make use of the Cells function to do this, although it's a bit difficult to extract the CellLabel. With the default CellLabelAutoDelete -> True, Cells will not return the CellLabel of a cell. The following function changes the option setting for CellLabelAutoDelete, and then looks for the time stamp of the given input cell:
cellTimes[n_Integer?Positive] := With[{cells = Cells[CellStyle->"Input"]},
Internal`WithLocalSettings[
CurrentValue[EvaluationNotebook[], CellLabelAutoDelete] = False,
gmtAbsoluteTimeToString @ Max @ CurrentValue[
Pick[
cells,
CurrentValue[cells, CellLabel],
"In["<>ToString[n]<>"]:="
],
CellChangeTimes
],
CurrentValue[EvaluationNotebook[], CellLabelAutoDelete] = Inherited
]
]
gmtAbsoluteTimeToString[time_] := DateString @ TimeZoneConvert[
DateObject[time,TimeZone->0]
]
For example:
DateString[]
"Thu 31 May 2018 11:13:46"
Pause[10]
cellTimes[$Line - 2]
"Thu 31 May 2018 11:13:46"
Cell > Notebook Historyperhaps? – AccidentalFourierTransform May 31 '18 at 17:53Map[Options[#, CellChangeTimes] &, Cells[EvaluationNotebook[]]]If Notebook history was turned on. Also if history is on you can also go to a cell and Ctrl+Shift+E to reveal a full form like of the cell and Ctrl+Shift+E again to return to standard display – Hans May 31 '18 at 17:57