Solved

basic date formatting question

Posted on 2007-04-04
3
147 Views
Last Modified: 2010-04-23
Hi

I have this code

 String.Format("{0:MM-dd-yyyy}", Session("deadline")

and its giving me this output

12/04/2007 00:00

how do i get rid of the time.
thanks
amdrea
0
Comment
Question by:andieje
[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 96

Accepted Solution

by:
Bob Learned earned 125 total points
ID: 18851848
What is the data type for Session("deadline")?  Is it a Date type or a string?

You could try something like this:

  DateTime.Parse(Session("deadline")).ToString("MM-dd-yyyy")

Bob
0
 

Author Comment

by:andieje
ID: 18858798
hi, its string
0
 

Author Comment

by:andieje
ID: 18858863
that did it
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

752 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