• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2815
  • Last Modified:

Date format in Visual Studio 2010

Hello all,

I was with VB6 before but i have now switch to Visual Studio 2010.

I need to adjust myself with some code.

I need to have a date format but in 2010, it does not work.

When i code:
lab_date.Text = Format(Date.Now, "dd mmm yyyy")

Open in new window


The result is: "18 02 2011" when it should be 18 Feb 2011.

What do i need to change?

Thanks for your help.
0
Wilder1626
Asked:
Wilder1626
  • 2
1 Solution
 
MrNedCommented:
The help documentation has the format string in upper case (http://msdn.microsoft.com/en-us/library/73ctwf33(v=vs.71).aspx), try this:

lab_date.Text = Format(Date.Now, "dd MMM yyyy")
0
 
Wilder1626Author Commented:
I also just found out that i could use:

lab_date.Text = Format(Date.Now, "Long Date")

Open in new window

0
 
Wilder1626Author Commented:
Thanks a lot for the quick response.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now