Something like this:
private void myDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 5)
{
var mydatetime = DateTime.Parse(myDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value);
if (mydatetime.Hour > 9 && mydatetime.Minute > 30)
{
e.CellStyle.BackColor = Color.Yellow;
}
}
}
Make sure the DateTime string in your DataGridView has the correct format, e.g.
"2008-05-01 7:34:42Z"
, you can omit the Time but not the Date part.
See:
DateTime.Parse Method (System)[
^]