Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/10/2010, 10:57
Avatar de Monimo
Monimo
 
Fecha de Ingreso: noviembre-2007
Ubicación: Mexico Df
Mensajes: 742
Antigüedad: 16 años, 5 meses
Puntos: 69
Respuesta: Fecha de nacimiento

System.DateTime theDay =
new System.DateTime(System.DateTime.Today.Year, 7, 28);

int compareValue;
try {
compareValue = theDay.CompareTo(System.DateTime.Today);
}
catch (ArgumentException) {
System.Console.WriteLine("Value is not a DateTime");
return;
}

if (compareValue < 0) {
System.Console.WriteLine("{0:d} is in the past.", theDay);
}
else if (compareValue == 0) {
System.Console.WriteLine("{0:d} is today!", theDay);
}
else if (compareValue == 1) {
System.Console.WriteLine("Value is null");
}
// compareValue > 0 && compareValue != 1
else {
System.Console.WriteLine("{0:d} has not come yet.", theDay);
}
__________________
La verdad es que lo que no quisiera dejar de hacer nunca (a parte de comer) es programar