What is wrong with a line like this? DateTime.Parse(myString)
Answers were Sorted based on User's Feedback
Answer / anand
Nothing wrong with the format really. Only problem is that
the result would depend on the Culture of the machine where
this line is getting invoked. Ideally you should also
supply the second parameter - or specify the Culture!
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / fusion
No .it can have one argument.
Eg. Response.Write(DateTime.Parse("10:50:39"))
will return you date and time.
such as 24/06/2008 10:50:39 AM
You can not simply have any irrlevant string,it should be
some string containing data or time value.
| Is This Answer Correct ? | 8 Yes | 5 No |
Answer / soner gönül
- Different cultures uses different standard date and time formats. This overload can create ambiguous values for the same string in different cultures. Eg: What should "01/02/2016" parsed as? 1 February? 2 January? It depends.
- The Calendar used by CurrentCulture might not have this date and time because of it's boundries.
If anyone interested, I wrote an article in Turkish about that subject.
http://sonergonul.net/datetime-parse-string-kullanmayi-birakamaz-miyiz/
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rahul misra
A statement like this should be used only after making sure
that the string contains DateTime data.
e.g DateTime.Parse("3 4") will return 3rd April 2009
(current year assuming DD-MM-YYYY as the datetime format as
per the machine's settings)
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / ish
DateTime.parse("","") will take two parameter one string
and other get other on object
| Is This Answer Correct ? | 4 Yes | 7 No |
What is asp.net mvc? : asp.net mvc
What is the difference between ExecuteReader,ExecuteNonQuery and ExecuteScalar.
What is operator overloading in dotnet
What is the first name space in .netF/W heirarchy
Explain the differences between Server-side and Client-side code?
12 Answers Cognizant, CTS, Siebel Systems, Visual Soft,
Does JITting occur per-assembly or per-method? How does this affect the working set?
What is xaml? Are xaml file compiled or built on runtime?
How can you provide an alternating color scheme in a Repeater control?
Types of optimization and name a few and how do u do?
Way of updating a table other than stored procedure and hard coded query?
What is the web.config file in asp?
what is .net
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)