ComponentOne True DBInput Pro 8.0
Features of the TDBDateX Object

This section describes the following TDBDateX object features:

Fiscal Properties

The TDBDateX object features date and time information based on the first month of the fiscal year. The FirstMonth property sets or returns the first month for fiscal year, FiscalEraYear returns the fiscal era year, FiscalQuarter also returns the fiscal quarter for the year. The FiscalHalf property returns the fiscal half for the year, FiscalMonth returns the fiscal month for the year, and FiscalYear returns the fiscal year. These features are very useful when working with financial systems.

Day Number and Week Number

The TDBDateX object can determine the number of a given day or week within the (fiscal) year, (fiscal) half, (fiscal) quarter, or month using the DayInfo and WeekInfo methods. The WeekPattern property can also be specified for how a week should be counted, to either row-based or in full weeks. The TDBDateX object also allows you to retrieve the total days and weeks within these periods using the TotalDays and TotalWeeks methods. Additionally, the TDBDateX object enables you to pick a date within a specified period using the PickDate method. For example, you can pick the one hundredth date within the first fiscal half within the current year.

Leap Year and Century

The TDBDateX object provides functionality checking for the leap year with the IsLeapYear property, and uses the Century property for retrieving the century information. The TDBDateX object includes many more useful features, such as the JulianDate property that returns the serial number for the underlying date and the PosInMonth property that returns the position in the current month. You can also retrieve a month table of all the days within the current month, including the trailing days, using the MonthTable property.

Date and Time Serial

The TDBDateX object allows you to set the date and the time value separately for the underlying value using the DateSerial and the TimeSerial properties. These properties can be used when importing values from the TDBDate and the TDBTime controls, which handle the date and time separately.

12-Hour Mode and Midnight Mode

The TDBDateX object provides the ability to set the 12-hour mode using the Hour12Mode property and the midnight mode using the MidnightMode property. With these properties you can express time values such as 00:00:00 AM or 12:00:00 AM or 24:00:00. The TDBDateX also features calculating the amount of minutes or seconds since midnight using the SinceMidnight method.

Weekdays

The TDBDateX object provides powerful features such as retrieving the next or the previous weekday with the NextWeekday and the PrevWeekday methods. For example, you can easily retrieve the upcoming Sunday from the current date. You can also enumerate all weekdays within a specified range using the EnumWeekdays method. For example, enumerate dates that land on the second and the fourth Saturdays within the current month.

Validation and Range Checking

The TDBDateX object provides features such as the InRange method for checking the given date if it is outside of the appropriate range. Also, the Match and the Compare methods are provided for comparing two dates to see if they match each other, if one is larger or smaller than another, or if they are equivalent.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback