O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Calendar

Synopsis

This abstract class determines the division and measurement of time in units, such as day, months, years, and eras. It is an abstract base class for culture-specific calendar implementations included in this namespace. Derived classes store the specific information about a calendar’s eras, lengths of years and months, and the sometimes esoteric rules for calculating leap years. These properties get used by DateTimeFormatInfo to properly display a date and time string from a specific DateTime value.

public abstract class Calendar {
// Protected Constructors
   protected method Calendar();  
// Public Static Fields
   public const field int CurrentEra;                            // =0
                  // Public Instance Properties
   public abstract field int[] Eras{get; } 
   public virtual field int TwoDigitYearMax{set; get; } 
// Public Instance Methods
   public virtual method DateTime AddDays(DateTime time, 
        int days);  
   public virtual method DateTime AddHours(DateTime time, 
        int hours);  
   public virtual method DateTime AddMilliseconds(
        DateTime time, double milliseconds);  
   public virtual method DateTime AddMinutes(DateTime time, 
        int minutes);  
   public abstract method DateTime AddMonths(DateTime time, 
        int months);  
   public virtual method DateTime AddSeconds(DateTime time, 
        int seconds);  
   public virtual method DateTime AddWeeks(DateTime time, 
        int weeks);  
   public abstract method DateTime AddYears(DateTime time, 
        int years);  
   public abstract method int GetDayOfMonth(DateTime time);  
   public abstract method DayOfWeek GetDayOfWeek( DateTime ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required