Solved

basic date formatting question

Posted on 2007-04-04
3
143 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
  • 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

773 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