What should you do?

You create the following variable in your code:
DateTime dateValue;
You additionally write code to store time in the local time to the dateValue variable.
You are required to serialize the value of the dateValue variable, if you serialize the DateTime object in one time zone and deserialized in a different time zone,
the local time represented as a result should be automatically adjusted to the second time zone.
You are to decide which expression to use.
What should you do?

You create the following variable in your code:
DateTime dateValue;
You additionally write code to store time in the local time to the dateValue variable.
You are required to serialize the value of the dateValue variable, if you serialize the DateTime object in one time zone and deserialized in a different time zone,
the local time represented as a result should be automatically adjusted to the second time zone.
You are to decide which expression to use.
What should you do?

A.
The dateValue.ToString(“yyyy-MM-ddTHH:mm:ss.fffffff”,CultureInfo.InvariantCulture)

B.
The dateValue.ToBinary() expression should be used

C.
The dateValue.Kind expression should be used

D.
The dateValue.Ticks expression should be used

Explanation:
To preserve the information that you are required to preserve in the scenario you should make use of the
new ToBinary and FromBinary method as these methods can be used to automatically adjust the local times.
Incorrect Answers:
A: The expression in question should not be used in the scenario because the expression will not preserver any of the required reserved information.
C: This expression will be used to check whether the value indicates whether time is represented by the instance is based on local time.
D: This expression is used to super fast serialize the required information but should not be considered when working with the local time.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


seenagape

seenagape

I have the same idea. B