Beispiel #1
0
            public DateTime getDateTime()
            {
                GPTimestamp ts = new GPTimestamp(Timestamp);

                return(new DateTime(ts.year, ts.month, ts.day, ts.hour,
                                    ts.minute, ts.second));
            }
Beispiel #2
0
            public string getDateString()
            {
                //1971-04-25 23:00:00 +0000
                GPTimestamp ts = new GPTimestamp(Timestamp);

                return(string.Format("{0:0000}-{1:00}-{2:00} {3:00}:{4:00}:{5:00} +0000", ts.year, ts.month, ts.day, ts.hour, 0, 0));
            }
Beispiel #3
0
 public Transition GetNextTransition(GPTimestamp ts)
 {
     foreach (Transition trans in Transitions)
     {
         if (trans.Timestamp > ts.getValue())
         {
             return(trans);
         }
     }
     return(null);
 }
Beispiel #4
0
        public bool hasDstInYear(int year)
        {
            foreach (Transition tr in Transitions)
            {
                if (GPTimestamp.Year(tr.Timestamp) == year)
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #5
0
        public DateTime EndDateInYear(int year)
        {
            Transition selected = null;

            foreach (Transition tr in Transitions)
            {
                if (GPTimestamp.Year(tr.Timestamp) == year && tr.Dst == false)
                {
                    selected = tr;
                    break;
                }
            }
            if (selected == null)
            {
                return(new DateTime());
            }
            return((new GPTimestamp(selected.Timestamp)).getDateTime());
        }