?
Solved

DateFormat Function in VS 2008

Posted on 2014-02-21
3
Medium Priority
?
148 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
[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 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

762 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