Skip to Main Content
C# in a Nutshell
book

C# in a Nutshell

by Ben Albahari, Ted Neward, Peter Drayton
March 2002
Intermediate to advanced content levelIntermediate to advanced
864 pages
31h 8m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# 8.0 in a Nutshell

C# 8.0 in a Nutshell

Joseph Albahari, Eric Johannsen
C# 10 in a Nutshell

C# 10 in a Nutshell

Joseph Albahari
C# in a Nutshell, Second Edition

C# in a Nutshell, Second Edition

Peter Drayton, Ben Albahari, Ted Neward
Code like a Pro in C#

Code like a Pro in C#

Jort Rodenburg

Publisher Resources

ISBN: 0596001819Catalog PageErrata