FIX: TTOD() Returns Incorrect Date with Time of 12:00:00 AMID: Q139835 3.00 WINDOWS kbprg kbbuglist kbfixlist The information in this article applies to:
SYMPTOMSWhen you use TTOD() on a variable containing a time of 12:00:00 AM, TTOD() returns an incorrect date. If one second is added to the date value, TTOD() returns the correct date.
CAUSE12 AM is considered to be the start of a new day, so at 12 AM, TTOD() should display the date for the next day. However, TTOD() miscalculates and incorrectly displays the date for the previous day.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.
MORE INFORMATIONThe TTOD() function returns a date value from a datetime function or value.
Steps to Reproduce ProblemIn the following example, a variable is set to 10/24/95 at 10 PM. Two hours are added to the value, one at a time. Then the date is checked to make sure it has switched to 10/25/95 12:00:00 AM. In the Command window, type the following commands: x = {10/24/95 22:00:00} && Initialize date variable to 10 PM Oct 24, 1995 The following two lines show that adding one second to 10/25/95 12:00:00 AM
does allow TTOD() to return 10/25/95 as expected:
KBCategory: kbprg kbbuglist kbfixlist
KBSubcategory: FxprgGeneral VFoxWin buglist3.00 fixlist5.00
Additional reference words: 3.00 date
|
Last Reviewed: November 1, 1997 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |