QuestionQ14

Variables and Arguments

A process uses a DateTime variable named "Timestamp." The developer needs to print the variable in the Output panel using the format "yyyy-MM-dd hh:mm." Which expression should be used to display its value?

  • A Timestamp.CompareTo(“yyyy-MM-dd hh:mm”)
  • B Timestamp.“dd-MM-yyyy”
  • C Timestamp.ToDateTime(“yyyy-MM-dd hh:mm”)
  • D Timestamp.ToString(“yyyy-MM-dd hh:mm”)
Explanation

DateTime.ToString("yyyy-MM-dd hh:mm") converts the DateTime value to its text representation using the supplied custom format string.

Community Discussion

No comments yet. Be the first to start the discussion!