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?
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?
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.
B is the correct answer
B is the correct answer