![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif)
Microsoft Year 2000 Readiness Disclosure & Resource Center |
![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif) |
![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif) |
![](/file/18315/Y2K_Resource_Nov99.iso/webcon~1/usa/year2k/images/spacer.gif) | Microsoft C 6.00a (English) - 16-Bit Win
Product Summary |
Product: Microsoft C Version: 6.00a |
Category: Compliant Operating System: 16-Bit Win |
Language: English |
Release Date: 17 Sep 1990 |
Operational Range: |
01 Jan 1980 - 18 Jan 2038 |
Can applications be built with this tool that adhere to the Microsoft Year 2000 Compliance Statement? Yes |
Prerequisites: |
None |
Product Dependencies: |
MSDOS 6.22 and OS/2 1.3 |
Clock Dependencies: |
System Clock |
Last Updated: |
21 Jul 1999 | |
Product Details |
Can applications be built with this tool that adhere to the Microsoft Year 2000 Compliance Statement?
Yes.
Note: This requires that any available and appropriate software updates have been applied.
How the product runtime handles dates:
Microsoft C 6.00a uses the following data types for dates:
Data type |
Range |
Time_t |
1/1/1970 through 1/18/2038 |
DOS dosdate_t |
1/1/1980 through 12/31/2108 |
Two-digit shortcut handling:
Two-digit dates are display only; there is no input of 2-digit days in the product.
Recommended practices to develop year 2000 compliant applications:
Please see the "Visual C++ and the Year 2000" best practices article located at http://msdn.microsoft.com/visualc
How the product handles dates: No intrinsic handling of dates.
Common development errors dealing with year 2000 date issues:
The most likely area for concern arises if users write their own date handling routines. Please see the "Visual C++ and the Year 2000" best practices article located at http://msdn.microsoft.com/visualc.
The Microsoft C Run Time provides two ANSI-C data structures to track time. These are
- struct tm
- time_t
ANSI types: struct tm and time_t
The ANSI C standard has established these types, their meaning and to some extent, the underlying type of each. In Visual C++, the type of time_t is long and it represents seconds since January 1, 1970 when used with the ANSI C functions that utilize variables of this type. The type struct tm is used to track the components of a date. The struct tm uses internal variables to store years as the number of years since 1900, the month of the year, day of the week, day of the month, day of the year, hour of the day, minute of the hour, and seconds of the minute are accounted for in this structure as well as if Daylight Savings Time is in effect. These members are of type int. These types are what ANSI functions use to manipulate, input, and output times. The Visual C++ documentation has more information on these types.
Avoiding issues with ANSI time functions
An application can appear to have a year 2000 issue because of how ANSI functions are permitted to behave. You can create year 2000 compliant applications and avoid confusing output from your programs if you follow some simple guidelines when using ANSI functions, primarily the strftime and wcsftime functions.
- Present 4-digit years when displaying dates to users of your application. When using the strftime and wcsftime functions, use %Y to display a 4-digit year instead %y (lowercase) which displays a 2-digit year. For example:
#include <time.h>
#include <stdio.h>
const int BUFSIZE = 256;
char buf[BUFSIZE];
int main()
{
struct tm now;
time_t tmp = time(0); // get current time
now = *localtime(&tmp); // get components
// 2-digit vs. 4-digit year
char fmt[] = " %m/%d/%y \n %m/%d/%Y ";
strftime( buf, BUFSIZ, fmt, &now );
printf(buf);
return 0;
}
- Require users of your application to provide fully qualified dates (using 4-digit years) when accepting date input into your application.
- Avoid using the %x or %c format, or if used, use # to get the long date version when using strftime and wcsftime. The %x and %c formatting codes default to printing a 2-digit year. Change the initialization of fmt in the above program to " %x \n %#x " to see the difference.
- Keep your times in a time_t variable or a struct tm and manipulate them there. ANSI C mandates some other time functions to aid in this task. Here is a list and brief description of these functions. See your Visual C++ documentation for more details.
- time û gets the current calendar time in a time_t
- difftime û computes the difference between two time_tÆs
- gmtime û converts a time_t to a struct tm, in terms of Coordinated Universal Time (UTC)
- localtime û converts a time_t to a struct tm, in terms of local time
- asctime, _wasctime û returns a string corresponding to the passed struct tm*. The string is of the form "DDD MMM dd HH:MM:SS YYYY\n\0" and is always 26 characters.
- ctime, _wctimeû given a time_t, returns the local time in the form of a string. Exactly the same as asctime( localtime( time_t_val ))
- mktime û returns a locally adjusted time_t given a struct tm*, which is updated so values fall into appropriate ranges. For example
#include <time.h>
#include <stdio.h>
const int BUFSIZE = 1024;
char buf[BUFSIZE];
int main()
{
struct tm now;
time_t tmp = time(0); // current time
now = *localtime(&tmp);
size_t len = strftime(buf, BUFSIZE, "%#c\n", &now);
now.tm_hour += 48; //jump ahead two days
// should get a bogus hour value
len += strftime(buf+len, BUFSIZE-len, "%#c\n", &now);
mktime(&now); // mktime will correct
strftime(buf+len, BUFSIZE-len, "%#c\n", &now);
printf(buf);
return 0;
}
Although not an ANSI function, the _strdate and _wstrdate functions generates a 9-character string to a buffer that it receives a pointer to as a parameter. The output has the form "MM/DD/YY". Use the strftime or wcsftime function instead.
Testing guidelines and recommendations:
Please see the "Visual C++ and the Year 2000" best practices article located at http://msdn.microsoft.com/visualc
| |
Return to Search Screen
Legend of Symbols: |
* |
The product is compliant with recommended customer action. This indicates a prerequisite action is recommended which may include loading a software update or reading a document. |
# |
The product is compliant with acceptable deviations from Microsoft's standard of compliance. An acceptable deviation does not affect the core functionality, data integrity, stability, or reliability of the product. |
+ |
The product is compliant with pending Year 2000 software updates. Future maintenance actions will be recommended shortly. See Product Guide for further details. |
Note: Compliance ratings given for each product assume that all recommended actions have been taken. |
If after reviewing this information you have additional questions related to this product, click here.
YEAR 2000 READINESS DISCLOSURE
ALL COMMUNICATIONS OR CONVEYANCES OF INFORMATION TO YOU CONCERNING MICROSOFT AND THE YEAR 2000, INCLUDING BUT NOT LIMITED TO THIS DOCUMENT OR ANY OTHER PAST, PRESENT OR FUTURE INFORMATION REGARDING YEAR 2000 TESTING, ASSESSMENTS, READINESS, TIME TABLES, OBJECTIVES, OR OTHER (COLLECTIVELY THE "MICROSOFT YEAR 2000 STATEMENT"), ARE PROVIDED AS A "YEAR 2000 READINESS DISCLOSURE" (AS DEFINED BY THE YEAR 2000 INFORMATION AND READINESS DISCLOSURE ACT) AND CAN BE FOUND AT MICROSOFT'S YEAR 2000 WEBSITE LOCATED AT http://www.microsoft.com/year2000/ (the "Y2K WEBSITE"). EACH MICROSOFT YEAR 2000 STATEMENT IS PROVIDED PURSUANT TO THE TERMS HEREOF, THE TERMS OF THE Y2K WEBSITE, AND THE YEAR 2000 INFORMATION AND READINESS DISCLOSURE ACT FOR THE SOLE PURPOSE OF ASSISTING THE PLANNING FOR THE TRANSITION TO THE YEAR 2000. EACH MICROSOFT YEAR 2000 STATEMENT CONTAINS INFORMATION CURRENTLY AVAILABLE AND IS UPDATED REGULARLY AND SUBJECT TO CHANGE. MICROSOFT THEREFORE RECOMMENDS THAT YOU CHECK THE Y2K WEBSITE REGULARLY FOR ANY CHANGES TO ANY MICROSOFT YEAR 2000 STATEMENT. EACH MICROSOFT YEAR 2000 STATEMENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. CONSEQUENTLY, MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. MOREOVER, MICROSOFT DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF ANY MICROSOFT YEAR 2000 STATEMENT IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY MICROSOFT OR ITS AUTHORIZED REPRESENTATIVES SHALL CREATE A WARRANTY OR IN ANY WAY DECREASE THE SCOPE OF THIS WARRANTY DISCLAIMER. IN NO EVENT SHALL MICROSOFT OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER REGARDING ANY MICROSOFT YEAR 2000 STATEMENT INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS, PUNITIVE OR SPECIAL DAMAGES, EVEN IF MICROSOFT OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, SO THE FOREGOING LIMITATION MAY NOT APPLY TO YOU. THE INFORMATION CONTAINED IN EACH MICROSOFT YEAR 2000 STATEMENT IS FOUND AT THE Y2K WEBSITE AND IS INTENDED TO BE READ IN CONJUNCTION WITH OTHER INFORMATION LOCATED AT THE Y2K WEBSITE, INCLUDING BUT NOT LIMITED TO MICROSOFT'S YEAR 2000 COMPLIANCE STATEMENT, THE DESCRIPTION OF THE CATEGORIES OF COMPLIANCE INTO WHICH MICROSOFT HAS CLASSIFIED ITS PRODUCTS IN ITS YEAR 2000 PRODUCT GUIDE, AND THE MICROSOFT YEAR 2000 TEST CRITERIA.
ANY MICROSOFT YEAR 2000 STATEMENTS MADE TO YOU IN THE COURSE OF PROVIDING YEAR 2000 RELATED UPDATES, YEAR 2000 DIAGNOSTIC TOOLS, OR REMEDIATION SERVICES (IF ANY) ARE SUBJECT TO THE YEAR 2000 INFORMATION AND READINESS DISCLOSURE ACT (112 STAT. 2386). IN CASE OF A DISPUTE, THIS ACT MAY REDUCE YOUR LEGAL RIGHTS REGARDING THE USE OF ANY SUCH STATEMENTS, UNLESS OTHERWISE SPECIFIED BY YOUR CONTRACT OR TARIFF.
|