示例#1
0
 public KrynnEvent(KrynnDateTime eventDT, KrynnDateTime currentDT, string name, string description)
 {
     this.DateTime    = eventDT;
     this.SecondsLeft = currentDT.SecondsUntil(this.DateTime);
     this.Name        = name;
     this.Description = description;
 }
示例#2
0
 public bool UpdateTime(KrynnDateTime currentDT)
 {
     this.SecondsLeft = currentDT.SecondsUntil(this.DateTime);
     if (SecondsLeft <= 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
        public int DaysSince(KrynnDateTime sinceDate)
        {
            int dateOneCount = 0;

            dateOneCount += sinceDate.Day;
            dateOneCount += sinceDate.Year * 336;
            dateOneCount += sinceDate.Month * 28;

            int dateTwoCount = 0;

            dateTwoCount += this.Day;
            dateTwoCount += this.Year * 336;
            dateTwoCount += this.Month * 28;
            return(dateTwoCount - dateOneCount);
        }
示例#4
0
        public int SecondsUntil(KrynnDateTime untilDate)
        {
            int dateOneCount = 0;

            dateOneCount += untilDate.Second;
            dateOneCount += untilDate.Minute * 60;
            dateOneCount += untilDate.Hour * 60 * 60;
            dateOneCount += untilDate.Day * 60 * 60 * 24;
            dateOneCount += untilDate.Month * 60 * 60 * 24 * 28;
            dateOneCount += untilDate.Year * 60 * 60 * 24 * 28 * 12;


            int dateTwoCount = 0;

            dateTwoCount += this.Second;
            dateTwoCount += this.Minute * 60;
            dateTwoCount += this.Hour * 60 * 60;
            dateTwoCount += this.Day * 60 * 60 * 24;
            dateTwoCount += this.Month * 60 * 60 * 24 * 28;
            dateTwoCount += this.Year * 60 * 60 * 24 * 28 * 12;

            return(dateOneCount - dateTwoCount);
        }