Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tcKpw-00Gwkv-C1 for pgsql-docs@arkaria.postgresql.org; Mon, 27 Jan 2025 08:51:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tcKpv-00ABp9-Fn for pgsql-docs@arkaria.postgresql.org; Mon, 27 Jan 2025 08:51:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tcKpv-00ABp1-7J for pgsql-docs@lists.postgresql.org; Mon, 27 Jan 2025 08:51:15 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tcKpq-001jQA-2R for pgsql-docs@lists.postgresql.org; Mon, 27 Jan 2025 08:51:14 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso666258266b.3 for ; Mon, 27 Jan 2025 00:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1737967870; x=1738572670; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=QOA756HpdtTP7YLff6gaO1sdVRmh1nr9pXPRtUfxYEY=; b=ZUzoy3JzipUr+FfMN4reUJQDEym3FNlpwOGEWV7POlxY6kdiumKqgxDHO9TfwABMj9 lRgFE9Wj26JBPw/8wbVe4LFFOkt2ph+t8vwblDJ/BlZfBbc8Mh9hoXXdTYmfyf7hT6CV faTeuNoBJNKSZGe9QKsDJKo1Ey1lHEy9CPhn+wxzvxUzcjzjlBlPI9PohERlVdoZy/cX 4rOswJyId0Ied2+gjibyKpjtmMMcrUaM6gcFa+6LY4r07Ws6tEAbwvhxNvYDdbRtPjah 3hw9YM19jDVKIlW0vhQTO3o7jLs6UAriymBLoeWwk5/CEswIqPnLAg+513aXQklZNsI7 WN4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737967870; x=1738572670; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QOA756HpdtTP7YLff6gaO1sdVRmh1nr9pXPRtUfxYEY=; b=Ccw5sknkwCwH2yWQIttTEQe9j9ObVyrA/c69Vpy/vPnMmaE+utgUgho40XDjboV17m vXWnzTxX7dcaG2veW85sFvdP7i7+ItpibZGrSAwSgxF7BMFEMeGHdSKX+oafV3t1pwXN L1uKWtEcdtXZFTmASxTGOWwdLkrAvDa/ipc/7n2e2uzAVJltd81UGONfP1quDDKRb6/p 4HZ1ZM1AeosGg3ljT3wao+cKE+SXBWPwntzZv+rGtoTlrF3HDrx9i5b7X3Wks6Jm0H2I W0H0F9jwbSN2yUH78LfbpMcalnE/V/NwwtbFiB7tc3lCdPV3RmKkY2bkMvaUQmpXGvqC BLNw== X-Forwarded-Encrypted: i=1; AJvYcCUhClypwY/aJTBCwKdWzBkY1pFit/hRRfnGtAswOKxuNSf43b/d32uMOWuPMmE2qRp0xwwmO7nUActW@lists.postgresql.org X-Gm-Message-State: AOJu0YxLZjPU8Se3GGQtHB8ZHshjhecSi5GLShu2hDxAhuqToEb5D1rw aCWhSIQVcPvnuMlqiI5BFzj7raYNsY1p8/ZQudd0V36NccjpxWEB0fr6QDnGS9AqCAe0B5lT5d9 7 X-Gm-Gg: ASbGncuN/V/cDEJzz4lMQ0RGskGL+dV9RP7/O0jZsLD8atRdf+IVkuZEp9X5+qVCI3l VDe9VVZLUPxLuybZee1iAkyzmEfuSww2Nn/ZEmofOD5tuWW09Gt6AJiHibT/kt7746lmfPyg4pB P6Syza/6knet84NX71JO3fe/YvuECMs+EElFRoernZ5l/LS1fpGygC5XAAFx6C3Z31jk6geCDDB hIGbWsB5xAqYOAC2TvAThW1M+ZQSFYk5pPD2nvoRV5F/yUjAkpfRSMstHbQxc2I9ZJtoc4CJdwY Qv/WhSwiAaj+lDy4S9XYVXw3 X-Google-Smtp-Source: AGHT+IHOp+z0iCcbVSp+L9DgZycj8vFpdRQWvYzL5aKNNtE2m/2rJhbg5fQ/RThNmR2Xh2KcO7+jHg== X-Received: by 2002:a17:906:79a:b0:ab3:a0ad:17a9 with SMTP id a640c23a62f3a-ab3a0ad203cmr2820626766b.24.1737967869659; Mon, 27 Jan 2025 00:51:09 -0800 (PST) Received: from localhost.localdomain ([2001:871:5e:d10a:515c:df26:bd3e:3870]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab6760b76acsm544926166b.113.2025.01.27.00.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 00:51:09 -0800 (PST) Message-ID: <7a7e09581d7e7fa548b4ab2cb823477e5cae14f7.camel@cybertec.at> Subject: Re: timestamp with time zone ~> GMT From: Laurenz Albe To: bristleconeweb@gmail.com, pgsql-docs@lists.postgresql.org Date: Mon, 27 Jan 2025 09:51:08 +0100 In-Reply-To: <173796426022.1064.9135167366862649513@wrigleys.postgresql.org> References: <173796426022.1064.9135167366862649513@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2025-01-27 at 07:51 +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: >=20 > Page: https://www.postgresql.org/docs/17/datatype-datetime.html > Description: >=20 > Thank you for postgres. I wanted to offer clarification would may help > others in the docs on time stamps (after discovering subtle issues have > significant impact for me) > https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-D= ATETIME-INPUT-TIME-STAMPS >=20 > "An input value that has an explicit time zone specified is converted to > UTC" > "When a timestamp with time zone value is output, it is always converted > from UTC to the current timezone zone" >=20 > After re-testing behavior, it appears this means: > 1. input DROPS the offset after conversion to UTC > 2. output is system time or according to settings (DROPS utc and original > time zone) >=20 > To help illustrate the dilemma: consider an example use case where an > airline is emailing flight departure and arrival times. Passengers typica= lly > need to know the times relative to the departure and destination time zon= es. > Passengers would be confused to see all times according to their current > time zone (which may be entirely different from the time zones of the > flight). Additionally, iCal must know both time zones to determine the tr= ue > flight time and render an accurate calendar.=20 >=20 > Suggestion: Assuming my understanding is accurate - clarify for the reade= r > that time zone offset is lost (after conversion to UTC). At risk of stati= ng > the obvious: "timestamp with time zone" is a rather misleading name. > "timestamp coerced to UTC" or something would be more accurate. >=20 > Since timestamp with time zone doesn't record the input time zone, there = is > an associated issue: how to record the input time zone. I'm unable to loc= ate > a recommendation through postgres docs. Certainly text or similar would > "work" for IANA time zones... however it would be helpful to have a littl= e > more guidance, such as validation to the enum > https://www.postgresql.org/docs/17/view-pg-timezone-names.html I consider= ed > using "time with time zone" but I see this is also coerced to UTC. >=20 > Hopefully these suggestions are helpful. Thanks again! Your understanding is correct. I personally think of "timestamp with time zone" as an "absolute timestamp"= . To preserve the original time zone that was entered, you'd have to store it in a separate database column. We welcome a documentation patch! Yours, Laurenz Albe