What data type should you use?

You manage a database named Exams accessed via a website. The website is regularly accessed by
users in different countries. You are redesigning a table named History that records when users have
purchased and taken online exams. You need one of the columns in the History table to record what
time of day that a user has taken an exam. Additionally, you need this column to have time zone
awareness. What data type should you use?

You manage a database named Exams accessed via a website. The website is regularly accessed by
users in different countries. You are redesigning a table named History that records when users have
purchased and taken online exams. You need one of the columns in the History table to record what
time of day that a user has taken an exam. Additionally, you need this column to have time zone
awareness. What data type should you use?

A.
datetimeoffset

B.
datetime

C.
Use two different columns with one column of datetime, and the second column indicating the
UTC offset

D.
datetime2

Explanation:
The datetimeoffset data type combines a date with a time of day that has time zone awareness. The
time is based on a 24-hour clock but also
includes a UTC offset. For the datetimeoffset data type, both the UTC and local datetime values will
be validated during update, insert,
convert, arithmetic, or assign operations. The recognition of any invalid UTC or local datetime value
will result in an invalid value error. For
example, the 9999-12-31 10:10:00 datetime value is valid in UTC, but it overflows in local time when
the time zone offset is +13:50.



Leave a Reply 2

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


Lena

Lena

DateTimeOffset structure provides a greater degree of time zone awareness

Google

Google

The info talked about within the report are several of the most beneficial available.