The information in this article applies to:
SYMPTOMSAn incorrect date is returned from the Format function. CAUSE
This problem can occur when the Grouping Symbol in the Regional Settings is
set to a period (.).
This problem is caused by the way the Format function handles the period
character when formatting. In this case, the Format function simply ignores
the period characters in the value before formatting occurs. In other
words, Visual Basic converts the date 31.1.97 to the Long value 31197, so
you receive the same result as if you typed:
RESOLUTIONThis problem can be avoided by converting the date to be formatted to a Date type before it is passed to the Format function. For example, if you have this statement:
change it to:
Because the Format function is capable of formatting several data types, it
is a good idea to always pass the value to be formatted as the specific
data type it represents to ensure there is no ambiguity.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Basic 6.0. MORE INFORMATIONSteps to Reproduce Behavior
Additional query words: kbVBp500bug kbVBp600fix kbVBA500bug kbVBA600bug KBVBA KBINTL kbVBp kbdsd kbDSupport
Keywords : |
Last Reviewed: October 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |