Exemple #1
0
        //Preconditions:None
        //Postconditions: a string with the date in the MM/DD/YYYY format will be returned.
        public override string ToString()
        {
            string result = Month.ToString("D2") + "/" +
                            Day.ToString("D2") + "/" + Year.ToString("D4");//override the Object ToString method

            return(result);
        }
Exemple #2
0
        // ToString Method
        public override string ToString()
        {
            string dateString = Month.ToString("d2") + "/" + Day.ToString("d2") + "/" + Year.ToString("d4");

            return(dateString);
        }
Exemple #3
0
        // Precondition: None
        // Postcondition: Creates a string in MM/DD/YYYY format
        public override string ToString()
        {
            string result = Month.ToString("D2") + "/" + Day.ToString("D2") + "/" + Year.ToString("D4");

            return(result);
        }