QuestionQ172

VerifiedData Manipulation

A developer has declared a DateTime variable named CurrentDate. Which expression can display the hour that was 12 hours before the date stored in the variable?

Explanation

DateTime.AddHours is an instance method that returns a new DateTime; supplying -12 moves the value back 12 hours. Its Hour property returns the resulting hour component. DateTime.AddHours(Double) Method

Learn more

Community Discussion

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