Solved

DateFormat Function in VS 2008

Posted on 2014-02-21
3
142 Views
Last Modified: 2014-02-25
Greeting,

The DateFormat.ShortDate gives me date like 2/7/2014. Is there anyway to get 02/07/2014?

Thanks.
0
Comment
Question by:mrong
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39877211
Use an explicit format specifier:

Dim d As DateTime = DateTime.Now
Dim s As String = d.ToString("MM/dd/yyyy")   ' Case important!

Open in new window


A good resource for format specifiers is here:  http://blog.stevex.net/string-formatting-in-csharp/
0
 

Author Comment

by:mrong
ID: 39885428
Can I use it in VS expression? thx
0
 

Author Comment

by:mrong
ID: 39885450
Should be the following in expression

=CDate(Fields!MyDay.Value).ToString("MM/dd/yyyy")
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

912 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