Operational Range for Data: System dependent
* Note: The below information refers to the code that is shared between Office 97 documents. Please see the individual applications for more detailed information on the product.
Description of how the product handles dates:
Dates and times that are displayed or query-able by the user are obtained from the operating system date and time, stored as fully qualified 4-digit year dates and displayed according to the user settings in the operating system. Setup has no date sensitivity except in the file removal DLL. See below for testing implications.
For VBA and the shared Office object model:
Since a common programming language (VBA v5) is used by all applications, date handling for all applications can be tested by testing the VBA intrinsic commands. These intrinsic functions for date handling include:
Now ()
CDate()
CVDate()
DateValue()
Date()
Date$()
Format()
DateAdd()
DateDiff()
DatePart()
IsDate()
Day()
Month()
Weekday()
Year()
All dates and times displayed are obtained from the operating system clock. All dates are stored using long format. A date may be displayed in 2 digit format (by formatting cells in an Excel worksheet, or using the VBA format function, for example) but the value is always carried as a long value.
When only given 2 digits, the product assumes the first 2 digits of the year according to the 2-digit rules described below.
Files produced by Office97 applications contain date information (DateCreated, DateModified, etcà) which are accessible programmatically. (All files created through normal file commands have 4 digit dates attached ) When only 2 digits are specified for the dates for these attributes, the leading two digits are also assumed according to the 2 digit rule below.
Shared Object Model Methods and Properties
Files stored in Office format (.xls, .doc, .ppt etc.) have date properties associated with them. These properties can be manipulated using VBA methods. Testing for Y2K has been done to ensure compliance.
Objects, Methods, Properties, and Collections possibly affected by Y2K
Microsoft Office Language Reference
Document Properties Object- Property type can be date eg msoPropertyTypeDate
CreationDate Property
LastPrintDate Property
LastSaveTime Property
PropertyTests Collection- Conditions for PropertyTests may be dates eg msoConditionNextMonth
Add Method
Condition Property
FileSearch Object
LastModified Property
2-digit shortcut handling:
System display options only within the shared Office features. See individual applications.
The Advanced Find functionality uses a 10-year window from current date to identify the appropriate century since file creation dates far in the future make little sense. Logic across individual applications within Office is designed to be appropriate for each particular application and can be found in their individual product guides.
For VBA and the shared Office object model:
The first 2 digits are assumed according to a specific rule in cases where only 2 digits are supplied for the date. The rule is:
2 digit dates between 00-29 are assumed to occur in the 21st century (2000-2029).
2 digit dates between 30-99 are assumed to occur in the 20th century (1930-1999).
This interpretation applies to all dates whether the date is used by an intrinsic function, the date is directly entered into an Office program, or the date information is assigned to a file attribute using VBA.
For more information see the VBA 5.0 Product Guide.
Common date usage errors:
Data exchange between Microsoft Office applications should avoid use of plain text data. If necessary, plain text data should be saved and manipulated with the full 4-digit year. VBA and ODBC will correctly handle Microsoft Office date typed data. Text values that contain date data should be assured to contain the full 4-digit year. Data entered or imported into Microsoft Office applications such as Microsoft Word or PowerPoint, which do not have data typing in the document format, will be treated as simple text so those applications should not be used to store dates that calculations are based on (except in the instance of document properties). Standard document properties can be consistently queried and used across all Office applications for date queries and calculations, both programmatically and through the user interface. However, user-defined custom properties could generate inconsistencies.
For VBA and the shared Office object model:
User-defined functions are a prime area of date handling errors. A poorly written function may lead to problems.
Dates that are stored as strings can also be a problem if there is an error in the information. The VBA language will interpret a string as a date if by rearranging the month/day/year order a valid date can be found. For example, both 3/30/98 (March 30, 1998) and 187/3/1 (March 1, 187) are valid dates even though the month/day/year order have changed.
Testing guidelines and recommendations:
In general, avoid testing in a production environment because one cannot predict side effects with other non-compliant products. Interoperability testing across Microsoft Office products can be conducted safely.
OFFCLEAN.DLL, the only date-sensitive portion of Office setup, removes templates except those installed in recent months. This does not affect Year 2000 compliance, but it could affect Year 2000 testing because moving the system clock ahead to test could cause more templates to be removed than would be otherwise.
Area
SubArea
MicrosoftÆs Testing Summary
File
Open/Save Dialog Document Properties
Document management features include file open/save bringing up the proper "OK to Replace?" confirmation dialog when attempting to save a file after the date/time has been changed; display of dates in results pane of dialog; sorting of dates in results pane of file open/save dialog.
Findfast
Creation date of index
Create an index with the date set to the year 2000. Click Index, create index, select the index mentioned and hit Information. Ensure that the date shown says the year 2000 or 00 depending on the regional settings.
Last modified date of index
Have Findfast set to update itself every 3 minutes. Set the system date to December 31, 1999, and have it roll over to the year 2000. Verify that updating mechanism for Findfast is not affected.
Creation date of file
Create a file created on January 1, 2000. Perform a search using an Office App for files created after December 30, 1999, and verify that the file was found.
Findfast (cont.)
Last modified date of file
Create a file last modified on January 1, 2000. Perform a search using an Office App for files last modified after December 30, 1999 and verify that the file was found.
Last printed date of file
Create a file last modified on January 1, 2000. Perform a search using an Office App for files last modified after December 30, 1999 and verify that the file was found.
Custom date property
Create a file with a custom date property of January 1, 2000. Perform a search using an Office App for files with that property set to a date later than December 30, 1999 and verify that the file was found.
Leap year testing
Repeat the above 5 tests using February 29 and 28, 2000, 2001, and 2004, as the dates used.
Log file
Verify that the log file shows the year 00 for any logs in the year 2000 if the regional settings are set to 2 digit format, and 2000 if the regional settings are set to 4 digit format.
Displayed dates
Verify that the displayed dates for the creation/last modified dates of the index show 00 for the year 2000 if the regional settings are set to 2 digit format, and 2000 if the regional settings are set to 4 digit format.
Setup
Complete Install
Complete install is a superset of other options. Should be performed on clean machine and on machine with Office version 95 installed with all combinations spanning the turn of the century.
Maintenance Mode
Remove All
For VBA and the shared Office object model:
Users testing applications written in VBA should be especially careful to test three main problem areas:
User-defined functions: Many applications contain user-defined functions written in VBA to deal with dates in various ways. Many of these functions store date values as strings. Manipulating these values improperly can result in date handling errors that are outside of the scope of the testing that was done at Microsoft on the Y2K issue.
The date usage error described above can cause problems if an error handling routine is meant to catch improperly entered dates. Since VBA rarely generates an error when a string date is used as an input, an error handling routine is unlikely to be called. In this case the proper programming technique would be to validate the data using code instead of relying on an error to signal an improper date.
Applications using the TransferText method in Access should be tested to determine how dates past 1999 are handled. It is preferable to re-write code that contains this method such that dates are transferred using date data types instead of text.
Code Example:
The following example illustrates the date window in action with various input dates.
Sub TestDate()
Dim MyDate As Date
MyDate = "1/1/00"
Format MyDate, "mm/dd/yyyy"
MsgBox MyDate
End Sub
MyDate input
Expected behavior
1/1/00 1/1/1 1/1/9 1/1/2000 4/1/98 10/24/29 7/4/30 2/29/00 2/29/1900
1/1/2000 1/1/2001 1/1/2009 1/1/2000 4/1/1998 10/24/2029 7/4/1930 2/29/2000 error- Type mismatch (1900 not a leap year)
Note that by excluding the quotations in setting the value of MyDate, VBA automatically interprets the date in 4 digit format as it is being entered.