Re: time with timezone for PostgreSql

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: time with timezone for PostgreSql
Дата
Msg-id 52E7F654.7010904@pinpointresearch.com
обсуждение исходный текст
Ответ на time with timezone for PostgreSql  (avpro avpro <avprowebeden@gmail.com>)
Список pgsql-novice
On 01/28/2014 10:00 AM, avpro avpro wrote:
hi,

I'm using Qt 5.2 to design my application and PostgreSql for my database.

i would like to find a way to insert in Qt in a QTimeEdit or a QLineEdit field the value of time with time zone as required by PostgreSql data type: time with time zone, meaning

12:45:30+01, +01 being the UTC+1.

could you give me some guideline where to start from?
thank you.
john

Start here:
http://www.postgresql.org/docs/current/static/datatype-datetime.html

But pay attention to the comments under 8.5.3, especially "We do not recommend using the type time with time zone":

PostgreSQL endeavors to be compatible with the SQL standard definitions for typical usage. However, the SQL standard has an odd mix of date and time types and capabilities. Two obvious problems are:

  • Although the date type cannot have an associated time zone, the time type can. Time zones in the real world have little meaning unless associated with a date as well as a time, since the offset can vary through the year with daylight-saving time boundaries.

  • The default time zone is specified as a constant numeric offset from UTC. It is therefore impossible to adapt to daylight-saving time when doing date/time arithmetic across DST boundaries.

To address these difficulties, we recommend using date/time types that contain both date and time when using time zones. We do not recommend using the type time with time zone (though it is supported by PostgreSQL for legacy applications and for compliance with the SQL standard). PostgreSQL assumes your local time zone for any type containing only date or time. Cheers,
Steve

В списке pgsql-novice по дате отправления:

Предыдущее
От: Erik Darling
Дата:
Сообщение: Re: Update with last known location?
Следующее
От: csmtcy
Дата:
Сообщение: Couldn't get the database from heroku