Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: calconv.h
Link against: ccon.lib

Class TGregorianCalendar

TGregorianCalendar

Support

Supported from 6.1

Description

Stores a date represented in the Gregorian calendar.

The date can be converted to another TCalendar-derived calendar using operator=(), defined in the base class, TCalendar.

Derivation

TArithmeticalCalendarBase class used in the derivation of TGregorianCalendar
TCalendarAbstract base class for calendars
TGregorianCalendarStores a date represented in the Gregorian calendar

Defined in TGregorianCalendar:
DateTimeToGregorian(), GetDate(), GregorianToDateTime, SetDate(), TGregorianCalendar()

Inherited from TCalendar:
operator=()


Construction


TGregorianCalendar()

TGregorianCalendar();

Description

Constructor. This constructs and initialises the Gregorian calendar, but the date is uninitialised.


TGregorianCalendar()

TGregorianCalendar(TReal);

Description

Constructor. This constructs and initialises the Gregorian calendar. The date is initialised to the Julian day value specified.

Parameters

TReal

The Julian day value to which to initialise the calendar (a number of days from 24/11/4713 BC).

[Top]


Get/set date


GetDate()

void GetDate(TArithmeticalDate&);

Description

Gets the date.

Parameters

TArithmeticalDate&

On return, contains the date.


SetDate()

TInt SetDate(TArithmeticalDate&);

Description

Sets the date. First checks that the date specified is of the correct format for the Gregorian calendar.

Parameters

TArithmeticalDate&

The date to set.

Return value

TInt

KCalConInvalidDate if the date is invalid, otherwise KErrNone.


GregorianToDateTime

void GregorianToDateTime(TDateTime& aDT);

Description

Gets the date stored in this object as a TDateTime.

Parameters

TDateTime& aDT

On return, contains the date represented as a TDateTime value. The time fields (hour, minute, second, microsecond) are all set to zero.


DateTimeToGregorian()

void DateTimeToGregorian(TDateTime& aDT);

Description

Assigns a date represented as a TDateTime to this object.

Parameters

TDateTime& aDT

Contains the date to assign to this object. The time components are ignored.