also DateTime.Parse(ddl.selecte
Main Topics
Browse All TopicsHi!
I have a drop down list with a list of dates in the format MM/dd/yyyy HH:mm:ss.fff . when I select a date from the dropdown list, it needs to be sent to thae database
and retrieve the information. In the table, the date is of the format yyyy-MM-dd HH:mm:ss.fff
when the send the value as DateTime.Parse(ddl.selecte
it's not converting the date to the appropriate format.
Please let me know, how can I get the desired format.
Thanks a lot in advance!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Datetime currentTime = DateTime.Now;
string currentTimeAsString = currentTime.ToString("yyyy
There is no formatting like that for dates in MS SQL Server. There is a limited one which is this:
http://www.blackwasp.co.uk
If this does not answer your question, please let me know what you would like to do exactly.
You don't store the value of a datetime in SQL server formatted... It is just an integer offset from some starting date (e.g. Jan. 01, 1970). If you wanted to store it formatted, then you would need to use a varchar/char column for storage.
What is your concern storing the date already formatted? Are you doing some separate reporting outside of your C# application for which you would like to maintain consistency? You can format the data in your C# app before displaying to the user if you are pulling data from the DB in your app.
Business Accounts
Answer for Membership
by: Omego2KPosted on 2009-10-25 at 12:14:29ID: 25657756
May you post the code please, additionally provide an input and an improper output? Also the desired output?