Resta de fechas con un datetimepicker

01/06/2006 - 01:43 por Jocobo | Informe spam
Como puedo hacer para averiguar o restarle una fecha a otra y sacar la
cantidad de dias o meses o años que hay entre ellas
 

Leer las respuestas

#1 Marlon Ramos
01/06/2006 - 06:43 | Informe spam
Talvez esto te sirva

DateTime fec1=new DateTime(2006,6,29);

DateTime fec2=new DateTime(2006,6,30);

// te da la diferencia en dias

Console.WriteLine(fec2 - fec1 );

Console.ReadLine();


Saludos,

Marlon Ramos
Software Architect
(MCSA, MCDBA, MCAD .Net, MCT)
http://mramosgt.blogspot.com

There are 10 types of people in this world; those that understand binary and
those that don't.



"Jocobo" wrote in message
news:
Como puedo hacer para averiguar o restarle una fecha a otra y sacar la
cantidad de dias o meses o años que hay entre ellas

Preguntas similares