Solved

Date format in Visual Studio 2010

Posted on 2011-02-17
3
2,440 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
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
MrNed earned 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now