using System;

namespace PassByRef
{
    public class Time
    {
        // prywatne zmienne składowe
        private int Year;
        private int Month;
        private int Date;
        private int Hour;
        private int Minute;
        private int Second;

        // publiczne metody akcesora
        public void DisplayCurrentTime()
        {
            System.Console.WriteLine("{0}/{1}/{2} {3}:{4}:{5}",
               Month, Date, Year, Hour, Minute, Second);
        }

        public void GetTime(int theHour, int theMinute, int theSecond)
        {
            theHour = Hour;
            theMinute = Minute;
            theSecond = Second;
        }

        // konstruktor
        public Time(System.DateTime dt)
        {
            Year = dt.Year;
            Month = dt.Month;
            Date = dt.Day;
            Hour = dt.Hour;
            Minute = dt.Minute;
            Second = dt.Second;
        }
    }

    class Tester
    {
        public void Run()
        {
            System.DateTime currentTime = System.DateTime.Now;
            Time t = new Time(currentTime);
            t.DisplayCurrentTime();

            int theHour = 0;
            int theMinute = 0;
            int theSecond = 0;
            t.GetTime(theHour, theMinute, theSecond);
            System.Console.WriteLine("Bieżąca godzina: {0}:{1}:{2}",
               theHour, theMinute, theSecond);
        }

        static void Main()
        {
            Tester t = new Tester();
            t.Run();
        }
    }
}