コード例 #1
0
ファイル: KrynnEvent.cs プロジェクト: oway13/KrynnTimeManager
 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
ファイル: KrynnEvent.cs プロジェクト: oway13/KrynnTimeManager
 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);
        }