DateTime handling - DarkWanderer/ClickHouse.Client GitHub Wiki
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 internallyLocal
DateTime
s are converted to UTC according to user's local timezone settingsUnspecified
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