Solved

basic date formatting question

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

13 Experts available now in Live!

Get 1:1 Help Now