I'm at a crossroads it turns out that I'm making a .Net application that receives me an example value 00:34 and that value I want to convert to int to pass it to the database example my time I get is:
00:14 and I want to convert it to an integer in relation that 00:00 is the integer 1 (ignoring the rest) 01:13 is the integer 2 and so on always ignoring the minutes only taking into account the hours here my code
movCentrales.Add(new tb_Movimientos_centrales
{
Fecha = Convert.ToDateTime(dtfechaRio.Rows[0].ToString().Substring(6, 4) + "-" + dtfechaRio.Rows[0].ToString().Substring(3, 2) + "-" + dtfechaRio.Rows[0].ToString().Substring(0, 2)),
Hora_movimiento = Convert.ToString(drhoraMov["Hora Movi#"]),
Horario = Convert.ToInt32(drHorario["Hora Movi#"]) +1,
Central_equipo = Convert.ToString(drCentralEquipo["Central/Equipo"]),
Consigna = Convert.ToString(drConsigna["Consigna"]),
Central_Configura = Convert.ToString(drCentralConfigura["F1"]),
});
dbContRio.SaveChanges();
The time I want to convert is the variable Timetable I was thinking about doing a convert.toint32 and adding one to some idea of how to do it: more info:
Hora:
00:14 = 1 --
00:59 = 1 --
01:25 = 2 --
01:00 = 2 --
02:13 = 3 --
and so on.