What is wrong with a line like this? DateTime.Parse(myString)

Answers were Sorted based on User's Feedback



What is wrong with a line like this? DateTime.Parse(myString)..

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

What is wrong with a line like this? DateTime.Parse(myString)..

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

What is wrong with a line like this? DateTime.Parse(myString)..

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

What is wrong with a line like this? DateTime.Parse(myString)..

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

What is wrong with a line like this? DateTime.Parse(myString)..

Answer / ish

DateTime.parse("","") will take two parameter one string
and other get other on object

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More ASP.NET Interview Questions

What is the Difference B/W Finalize() and Dispose() in .Net?

12 Answers   HCL, IBM,


can u debug application programatically? if yes how?

0 Answers   FactorH,


Can we set master page as a start page?

0 Answers  


What the use of Form Authentication and windows Authentication?

1 Answers   NetCity, TCS,


Is it possible to apply themes to an asp.net application? If yes, then how?

0 Answers  






What are the components of ado.net?

0 Answers  


What are the new features implemented in ASP.NET?

0 Answers   TCS,


How will you write a web service for secure socket layer? What is secure socket? Have you done any socket programming? What is single thread and multi thread? What are the differences between .NET 1.1 and .NET 2.2? What is the command to connect to a StoredProcedure? How many types of Adapters are available in ADO.NET? Why DataAdapters are important? What is DataSet? It's important to compile the ASP.NET application before using it? What protocol you use to stream the audio and Video data? What are the different kind of network protocols? Write how will you connect to a database using DataSet? Why we use AJAX? What AJAX can do which JavaScript can't do? In a page using Windows Media API, if we press a button and in succession quickly press another button, what do you think will happen? Will the application wait for the first button response and then execute the second one or directly second button command will execute. What is the architecture of your application? What is connection pooling in SQL? Tell some functions of Windows Media API? How you will detect, whether the ActiveX is installed in the system before accessing it? What are validators are available in ASP.NET? What are the basic concepts of OOPS? What is abstraction?

0 Answers   Tesco,


which is the new version of IIS SERVER

1 Answers  


if i have placed the button control with the OnClick event like <asp:Button ID="mybutton" runat="server" Text="Insert" onclick="mybutton_Click" /> and some other controls(buttons, textboxes) in .aspx page. When i run the page, the button displays in the page source of the browser like <input type="submit" name="mybutton" value="Insert" id="mybutton" /> here, it does not display the onclick event, then how the page calls the button click on the server side, how the server side identify which button cause the submit, and how this page moves to the server side.

1 Answers  


What is a page life cycle?

0 Answers  


How do you deploy your asp.net application?

0 Answers  


Categories