CSharp · Console
using System;
public class Program
{
public static void Main()
{
DateTime entrada = new DateTime(2017,07,27, 20,12,0,0); //entrou em 27/07 as 20 horas
DateTime saida = new DateTime(2017,07,28, 7,28,0,0); //saiu no dia seguinte as 7 horas
TimeSpan horas = saida - entrada;
Console.WriteLine(string.Format("Total de {0} horas e {1} minutos trabalhadas", horas.Hours, horas.Minutes));
}
}