Advertisement
GabrielDas

Untitled

Jun 6th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace P05DateModifier
  6. {
  7. class DateModifier
  8. {
  9. private string firstDate;
  10. private string secondDate;
  11.  
  12. public DateModifier(string firstD, string secondD)
  13. {
  14. this.firstDate = firstD;
  15. this.secondDate = secondD;
  16. }
  17.  
  18. public string FirstDate
  19. {
  20. get { return this.firstDate; }
  21. set { this.firstDate = value; }
  22. }
  23. public string SecondDate
  24. {
  25. get { return this.secondDate; }
  26. set { this.secondDate = value; }
  27. }
  28.  
  29. public int Difference()
  30. {
  31. DateTime firstDate = DateTime.Parse(FirstDate);
  32. DateTime secondDate = DateTime.Parse(SecondDate);
  33.  
  34. int diff = Math.Abs((firstDate - secondDate).Days);
  35.  
  36. return diff;
  37. }
  38.  
  39.  
  40.  
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement