Solved

DateFormat Function in VS 2008

Posted on 2014-02-21
3
141 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 74

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

12 Experts available now in Live!

Get 1:1 Help Now