UiADPv1 Exam QuestionsBrowse all questions from this exam

UiADPv1 Exam - Question 59


A developer has defined a variable named “CurrentDate” of type DateTime. Which of the following expressions can be used to show what hour was 12 hours prior to the date from the variable?

Show Answer
Correct Answer: B

To calculate what hour was 12 hours prior to a given DateTime variable named 'CurrentDate', use the AddHours method with a negative value. The correct expression is CurrentDate.AddHours(-12).Hour.

Discussion

2 comments
Sign in to comment
AndresPCOption: B
Feb 13, 2024

B is the correct answer

ChoudayyaOption: B
Feb 28, 2024

B is the correct answer