PrepAway - Latest Free Exam Questions & Answers

Which of the following is the DateTime method that is being included?

You work as a developer at ABC.com. The ABC.com network consists of a single domain named
ABC.com.
You have been tasked with creating an application allows users to enter time and dates. You are
writing code that includes a DateTime method, which converts the indicated string representation
of a date and time to its DateTime equivalent using the specified format, culture-specific format
information, and style. The method requires the format of the string representation to match the
specified format exactly. The method then returns a value that indicates whether the conversion
was successful.
Which of the following is the DateTime method that is being included?

PrepAway - Latest Free Exam Questions & Answers

A.
TryParse(String, DateTime)

B.
TryParse(String, IFormatProvider, DateTimeStyles, DateTime)

C.
TryParseExact(String, String, IFormatProvider, DateTimeStyles, DateTime)

D.
TryParseExact(String, String[], IFormatProvider, DateTimeStyles, DateTime)

Explanation:

6 Comments on “Which of the following is the DateTime method that is being included?

  1. don't test me says:

    C seems to be more appropriate because the question implies the use of a single specific format, not more possible formats.
    D would have been correct if you needed to match against multiple formats, hence the array of formats.




    1



    0

Leave a Reply