Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace P05DateModifier
- {
- class DateModifier
- {
- private string firstDate;
- private string secondDate;
- public DateModifier(string firstD, string secondD)
- {
- this.firstDate = firstD;
- this.secondDate = secondD;
- }
- public string FirstDate
- {
- get { return this.firstDate; }
- set { this.firstDate = value; }
- }
- public string SecondDate
- {
- get { return this.secondDate; }
- set { this.secondDate = value; }
- }
- public int Difference()
- {
- DateTime firstDate = DateTime.Parse(FirstDate);
- DateTime secondDate = DateTime.Parse(SecondDate);
- int diff = Math.Abs((firstDate - secondDate).Days);
- return diff;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement