Tema: Restar horas
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/03/2010, 23:47
Avatar de atak
atak
 
Fecha de Ingreso: julio-2005
Ubicación: Huancayo
Mensajes: 490
Antigüedad: 21 años, 2 meses
Puntos: 5
De acuerdo Restar horas

Hola, eduardo2009

No tengo exactamente como tu caso pero en algo puede ayudarte esta solucion.
Controles:
Código PHP:
Formulario ( text : Fechas )
Dos Labels ( Hora Inicial, Hora Final)
Dos Controles DateTimePicker
Primero
: name ( dtpInicial ) Format ( Custom ) CustomFormat ( hh:mm tt )
Segundo: name ( dtpFinal ) Format ( Custom ) CustomFormat ( hh:mm tt )
Agregamos un Button name ( btnDiferencia ) text (Diferencia)
Agregamos un textBox name( txtHora ) ReadOnly ( True ) 
Evento Cick del Button

Código PHP:


private void btnDiferencia_Click(object sender, EventArgs e)
{
string cadena;

cadena=string.Format("{0:t0}",(dtpFinal.Value - dtpInicial.Value));

txtHora.Text = cadena.Substring(0, 5);
} 


Saludos ...
__________________
. .: El mejor Inicio :. .