1

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.

Nagaraj S
  • 13,316
  • 6
  • 32
  • 53
GeminiYellow
  • 1,016
  • 2
  • 12
  • 34
  • possible duplicate of [Date time conversion from timezone to timezone in sql server](http://stackoverflow.com/questions/16872007/date-time-conversion-from-timezone-to-timezone-in-sql-server) – philshem Feb 26 '14 at 08:14

1 Answers1

3

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

Community
  • 1
  • 1
TFD
  • 23,890
  • 2
  • 34
  • 51
  • thank for your answer, but ... in my project, there is too much data use the sepecial time zone. and, i have to keep new data use the same time zone. so, what i can do is try to convert the utc or whatever to . – GeminiYellow Feb 26 '14 at 23:40
  • To much data? Like you have more than a billion rows of dates? Even that could be re-written in an over night job! Fix your problems sooner rather than later. Think of the next programmer. What mess will they inherit? – TFD Feb 27 '14 at 19:42
  • oh...i think so, i hope so.but i cant. – GeminiYellow Feb 28 '14 at 02:57