hvdbovenkamp Posted September 19, 2008 Posted September 19, 2008 Hi there, I'm stuck with a problem formatting a datetime value: Dim thisdate As DateTime = #10/15/2005# Me.Label1.Text = Format(thisdate, "mm/dd/yyyy").ToString Returns 00/15/2005 setting the month to 00 instead of 10 I must be doing something wrong, for I don't find any mentioning of this problem. I use VB.NET Visual Studio 2003 Any help is more then welcome ! Quote
Administrators PlausiblyDamp Posted September 19, 2008 Administrators Posted September 19, 2008 mm is for minutes, MM is for months ;) Also you might find thisdate.ToShortDateString will do the same (and will return the string correctly for the current locale). In your code the .ToString isn't needed as Format() returns a string anyway. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.