Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Date format in Visual Studio 2010

Posted on 2011-02-17
3
Medium Priority
?
2,696 Views
Last Modified: 2012-08-14
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
Comment
Question by:Wilder1626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
MrNed earned 2000 total points
ID: 34922279
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
 
LVL 11

Author Comment

by:Wilder1626
ID: 34922314
I also just found out that i could use:

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

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 34922324
Thanks a lot for the quick response.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question