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
Solved

basic date formatting question

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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