Sample Code:
DateTime:
DateTime myDate = datetime.now();
DateTime dueDate =
DateTime.newInstance(
2008, 1, 30
);
//return true if myDate and dueDate are same else return false
Boolean dueNow = myDate.isSameDay(
dueDate
);
Date:
Date myDate = Date.today();
Date dueDate = Date.newInstance(
2008, 1, 30
);
//return true if myDate and dueDate are same else return false
Boolean dueNow = myDate.isSameDay(
dueDate
);