RWDate is deprecated and is no longer supported. Please be aware that this class may be removed from the product in the future. Please use RWDateTime instead.
See the SourcePro C++ API Reference Guide for a complete description of RWDate. Refer to Section 3.8 for information about migrating to RWDateTime.
RWDate is unable to store dates prior to 1 Jan 1901.
You can construct an RWDate in several ways:
With the current date:
RWDate d; |
This is the default constructor for RWDate. Because this method of construction must check the system date each time it creates an instance of an RWDate, constructing a large array of RWDate can be very slow. You should consider using RWDateTime in such cases.
For a given day of the month (1-31), month number (1-12) and year. Although the class supports 2-digit year specifiers, we urge you to use the 4-digit variety if possible to avoid confusion:
RWDate d1(1, 24, 2001) // 1/24/2001 RWDate d2(1, 24, 01) // 1/24/1901 (oops!) |
Using locale-specific strings. If you do nothing, a default locale using United States conventions and names is applied:
RWDate d1(10, "June", 2001); // 6/10/2001 |
Using French month names. Assuming your system supports a French locale, you could construct an RWDate with the following:
RWDate d2("10 Juin 2025") // 6/10/2025 |
For detailed examples on using locales, see Chapter 7.
Note that the default format for an RWDateTime on many systems and in many locales contains only a two-digit year. You can enforce the use of a four-digit year by defining the build macro RW_CENTURY_REQD in RCB when building the libraries. See Section 3.5.1, "About Two or Four Digit Years," in the section on RWDateTime.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.