-
-
Notifications
You must be signed in to change notification settings - Fork 56
DateTime handling
Oleg V. Kozlyuk edited this page Sep 14, 2022
·
4 revisions
ClickHouse.Client
tries to correctly handle timezones and DateTime.Kind
property. Specifically:
-
DateTime
values are returned as UTC. User can then convert them themselves or useToLocalTime()
method onDateTime
instance - When inserting,
DateTime
values are handled in following way:-
UTC
DateTime
s are inserted 'as is', because ClickHouse stores them in UTC internally -
Local
DateTime
s are converted to UTC according to user's local timezone settings -
Unspecified
DateTime
s are considered to be in target column's timezone, and hence are converted to UTC according to that timezone
-
- For columns without DateTime specified, client timezone is used by default (legacy behavior).
UseServerTimezone
flag in connection string can be used to use server timezone