Beispiel #1
0
 public void Copy(GPGregorianTime vc)
 {
     p_year  = vc.getYear();
     p_month = vc.getMonth();
     p_day   = vc.getDay();
     setDayHours(vc.getDayHours());
     setLocationProvider(vc.getLocationProvider());
     recalculateJulianGreenwichTime();
 }
Beispiel #2
0
        // vracia -1, ak zadany den je den nasledujuci po THIS
        // vracia 1 ak THIS je nasledujuci den po zadanom dni
        public int CompareYMD(GPGregorianTime v)
        {
            if (v.getYear() < getYear())
            {
                return((getYear() - v.getYear()) * 365);
            }
            else if (v.getYear() > getYear())
            {
                return((getYear() - v.getYear()) * 365);
            }

            if (v.getMonth() < getMonth())
            {
                return((getMonth() - v.getMonth()) * 31);
            }
            else if (v.getMonth() > getMonth())
            {
                return((getMonth() - v.getMonth()) * 31);
            }

            return(getDay() - v.getDay());
        }
Beispiel #3
0
        public bool IsBeforeThis(GPGregorianTime date)
        {
            int y1, y2, m1, m2, d1, d2;

            d1 = this.getDay();
            d2 = date.getDay();
            m1 = this.getMonth();
            m2 = date.getMonth();
            y1 = this.getYear();
            y2 = date.getYear();

            if (y1 > y2)
            {
                return(false);
            }
            else if (y1 < y2)
            {
                return(true);
            }
            else if (m1 > m2)
            {
                return(false);
            }
            else if (m1 < m2)
            {
                return(true);
            }
            else if (d1 < d2)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }