GeminiYellow
GeminiYellow

Reputation: 1013

could i insert a datatime into database as specific timezone?

as the title,

i want to insert a datetime into a table, for example'

Table'

--------------------------
NAME | Type
--------------------------
Id   | Int
Time | Datetime
--------------------------

and whatever i insert timezone +9 or timezone -9, it could saveas timezone +2 in database.

Upvotes: 1

Views: 98

Answers (1)

TFD
TFD

Reputation: 24534

Always use UTC time-zone, and in your display logic do the conversions required each way

Save much confusion later in the project, or when multiple time-zones are required in the future!

See

for further discussions

Upvotes: 3

Related Questions