469,330 Members | 1,379 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

parsing date string

HI,
i have string in format
dd/mm/yyyyy hh:mm:ss
and giving this as an input to DateTime.Parse gives a string was not
recognized as a valid date time format string error.
how do i make the parse method to accept formating that i need.
if i do console.writeLine DateTime.Now.ToString it gives the format:
YYYY-MM-DD HH:MM:SS

TIA, Z.
Nov 21 '05
50 4513
"BabyEmperor" <Ba*********@discussions.microsoft.com> schrieb:
I also had a problem with datetime. Searched a lot on the net. Read
through
a lot of articles. But, none was of any help.

At Last i found an MSDN article which explains the datetime class. it
solved
my problem. its a very good article.

The link of this article is
http://msdn.microsoft.com/netframewo...ndTimeFAQ.aspx.

After going through the article i found that the best way is the following
:

Date.Today.ToString( System.Globalization.CultureInfo.InvariantCulture )

Hope it solves all of your problems and help you in understanding the
DateTime class.


Whose problem?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #51

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Gerrit Holl | last post: by
3 posts views Thread by dont bother | last post: by
9 posts views Thread by Thomas W | last post: by
reply views Thread by bj0011 | last post: by
6 posts views Thread by Tim N. van der Leeuw | last post: by
reply views Thread by Uncle Leo | last post: by
10 posts views Thread by Stu | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.