Fan.Sys.TimeZone.isDstDate C# (CSharp) Méthode

isDstDate() static private méthode

Return if given date is the DstTime transition date
static private isDstDate ( Rule rule, DstTime x, int year, int mon, int day ) : bool
rule Rule
x DstTime
year int
mon int
day int
Résultat bool
        internal static bool isDstDate(Rule rule, DstTime x, int year, int mon, int day)
        {
            return compareMonth(x, mon) == 0 &&
             compareOnDay(rule, x, year, mon, day) == 0;
        }

Usage Example

Exemple #1
0
        public long hoursInDay()
        {
            int year  = getYear();
            int month = getMonth();
            int day   = getDay();

            TimeZone.Rule rule = tz().rule(year);
            if (TimeZone.isDstDate(rule, rule.dstStart, year, month, day))
            {
                return(23);
            }
            if (TimeZone.isDstDate(rule, rule.dstEnd, year, month, day))
            {
                return(25);
            }
            return(24);
        }