Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC

Class TDate

Instances of TDate represent an instant in time, with the precision of a second. It is possible to obtain the system current time by creating an instance without passing any arguments to the constructor.

Method Summary
after aDate
         Checks if the date represented by the object is more recent than another date.
before aDate
         Checks if the date represented by the object precedes another date.
compare aDate
         Compares this date object with another.
constructor
constructor aYear aMonth aDay anHour aMinute aSecond
constructor aYear aMonth aDay
constructor aDate
constructor aString
         Initializes the TDate object with a given date.
getDay
         Fetches the value of the day component of the TDate object.
getDayOfWeek
         Fetches the day of the week associated with the TDate object.
getHour
         Fetches the value of the hour component of the TDate object.
getMinute
         Fetches the value of the minutes component of the TDate object.
getMonth
         Fetches the value of the month component of the TDate object.
getSecond
         Fetches the value of the seconds component of the TDate object.
getYear
         Fetches the value of the year component of the TDate object.
notSame aDate
         Checks if the date represented by the object is not the same as another date.
same aDate
         Checks if the date represented by the object is the same as another date.
setDate aYear aMonth aDay anHour aMinute aSecond
setDate aYear aMonth aDay
setDate aDate
setDate aString
         Changes the date the TDate object represents.
setTime anHour aMinute aSecond
         Changes the hour, minute and second components of the TDate object, leaving all the others unchanged.

Method Detail

after

TDate after aDate

Checks if the date represented by the object is more recent than another date.

Parameters:
aDate - The TDate object it will be compared against.
Returns:
True if the object represents a date after the date represented by aDate. False otherwise.


before

TDate before aDate

Checks if the date represented by the object precedes another date.

Parameters:
aDate - The TDate object it will be compared against.
Returns:
True if the object represents a date before the date represented by aDate. False otherwise.


compare

TDate compare aDate

Compares this date object with another.

Parameters:
aDate - The TDate object it will be compared against.
Returns:
-1 if this date preceded aDate. 0 if this date is exactly the same as aDate. 1 if this date comes after aDate.


constructor

TDate constructor
TDate constructor aYear aMonth aDay anHour aMinute aSecond
TDate constructor aYear aMonth aDay
TDate constructor aDate
TDate constructor aString

Initializes the TDate object with a given date.

Parameters:
aYear - Integer representing the year component the TDate object will be initialized with.
aMonth - Integer representing the month component the TDate object will be initialized with.
aDay - Integer representing the day component the TDate object will be initialized with.
anHour - Integer representing the hour component the TDate object will be initialized with.
aMinute - Integer representing the minute component the TDate object will be initialized with.
aSecond - Integer representing the seconds component the TDate object will be initialized with.
aString - String representing a date in the format "[YY]YYMMDD[hhmm[ss]]".

The aString argument may have 6, 8, 12 or 14 characters of length. When it has 6 characters it is taken to represent a date in the "YYMMDD" format, where values of the year component less than 70 are taken to belong to the XXI century.

getDay

TDate getDay

Fetches the value of the day component of the TDate object.

Returns:
An integer value representing the month component of this TDate object.

Fetches the day component of the TDate object and returns an integer with its value. The value will always be between 1 and 31.

getDayOfWeek

TDate getDayOfWeek

Fetches the day of the week associated with the TDate object.

Returns:
An integer value representing the day of the week of the TDate object.

The returned value will always be between 0 and 6. Sunday is 0. Saturday is 6.

getHour

TDate getHour

Fetches the value of the hour component of the TDate object.

Returns:
An integer value representing the hour component of this TDate object.

Fetches the hour component of the TDate object and returns an integer with its value. The returned value will always be between 0 and 23.

getMinute

TDate getMinute

Fetches the value of the minutes component of the TDate object.

Returns:
An integer value representing the minutes component of this TDate object

Fetches the minutes component of the TDate object and returns an integer with its value. The returned value will always be between 0 and 59.

getMonth

TDate getMonth

Fetches the value of the month component of the TDate object.

Returns:
An integer value representing the month component of this TDate object

Fetches the month component of the TDate object and returns an integer with its value. The value will always be between 1 and 12. January is represented by 1 and December by 12.

getSecond

TDate getSecond

Fetches the value of the seconds component of the TDate object.

Returns:
An integer value representing the seconds component of this TDate object

Fetches the seconds component of the TDate object and returns an integer with its value. The returned value will always be between 0 and 59.

getYear

TDate getYear

Fetches the value of the year component of the TDate object.

Returns:
An integer value representing the year component of this TDate object.

Fetches the year component of the TDate object and returns an integer with its value.

notSame

TDate notSame aDate

Checks if the date represented by the object is not the same as another date.

Parameters:
aDate - The TDate object it will be compared against.
Returns:
True if the object represents a date that is not the same date represented by aDate. False otherwise.


same

TDate same aDate

Checks if the date represented by the object is the same as another date.

Parameters:
aDate - The TDate object it will be compared against.
Returns:
True if the object represents a date that is the same date represented by aDate. False otherwise.


setDate

TDate setDate aYear aMonth aDay anHour aMinute aSecond
TDate setDate aYear aMonth aDay
TDate setDate aDate
TDate setDate aString

Changes the date the TDate object represents.

Parameters:
aYear - Integer representing the year component the TDate object will be initialized with.
aMonth - Integer representing the month component the TDate object will be initialized with.
aDay - Integer representing the day component the TDate object will be initialized with.
anHour - Integer representing the hour component the TDate object will be initialized with.
aMinute - Integer representing the minute component the TDate object will be initialized with.
aSecond - Integer representing the seconds component the TDate object will be initialized with.
aDate - A TDate object.
aString - String representing a date in the format "[YY]YYMMDD[hhmm[ss]]".

The aString argument may have 6, 8, 12 or 14 characters of length. When it has 6 characters it is taken to represent a date in the "YYMMDD" format, where values of the year component less than 70 are taken to belong to the XXI century.

setTime

TDate setTime anHour aMinute aSecond

Changes the hour, minute and second components of the TDate object, leaving all the others unchanged.

Parameters:
anHour - Integer representing the hour component the TDate object will be initialized with.
aMinute - Integer representing the minute component the TDate object will be initialized with.
aSecond - Integer representing the seconds component the TDate object will be initialized with.



Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC
Report a bug or request new features
© 2002