From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24900 invoked from network); 7 Jan 2022 00:40:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Jan 2022 00:40:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1641516046; b=nYXnEG6dn7s0giJyWeDez/O1DuIXNT4XUDSvBQGDrNdf9Z9BLJGCzrAfnHb2Tb5dxaKzyGnzi0 3H8mH4HUhzvrbbbEppFSQs4KuZIoy389jGD9YcfoECAQ05lwt/s3xWr4ocxDnHnUoezPFcKPDX LmIpmXX9l8yF3j0aBji2ppal0bwuj0VKZKKneR8BCW1Iy/gTj8+kBRfE5S2CK+q+kkY6ZHyaWk H7OzDm56nhh9DLzd0bSxUfjCkHkVEDfR1v7TgR0Ch6Ok+OIcTliEOZH6T2cwgaj+npngORdoFM fzNHdMW8aDu+WYu2rdsHyFVi0HcBP9jfs13ZEDetso6BZA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1641516046; bh=rBlOvDTWOTaZW7Jvg8+rwMKTTvn/KBY/IxC9TkxC0/c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:Reply-To: MIME-Version:DKIM-Signature:DKIM-Signature; b=N4inz9kZWZw9RHlDrixq8HT7iE7+380k1EQZA9fySMBZtvQ37ij/OC2MADaJk2JfVtUQ7JbIfw +l9L3N11fX1LbI4U7IgyOtJKskd6S6ix/cdRCHsH996WOmoqskUNyLTfVgNw8g3M/zw9sH6LnP iCGErkHb+LiQlNR3httJIeXYl8dw32Htrc6JfjZn4FPldfSQ+AFmLlGK6C5AmaIqA3VLips04b p07a7kd9viLiIc/ATVrxu9df6p57CAFCFw6Mn7FbOUqemJj2WYx87nHltgynYkvK4o5dijR8I0 CeMJtMGejWr84zLX7ZYRRnUO5WVqxC7gH7RerrNjf38R1A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:Reply-To:MIME-Version:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=Oj5rV8Xo2Rn53QYyZ4/JM0VpCW4yxfBf5XQNx7A5zIM=; b=lbc76rNfIR0bhN2nVJzGRqVPfz TrQCusN2zphlbp+A/PVNOBFvVTQMpC2hbnxAzXZKgZJgktxroHL6q53sIgYpzdrW5qWYB3AfkPuHK r4nPnJ6irVj7JMJ8pihZg9zPjXm43xRURcrWdg+JZnVdP7a+UUh6xBkMnn+Xz84pCtI0rGSG29hzH MQWU9etkn29GglI3Gvi0Wteir1k9LxDh3hpSkE3Nsm/azbNCOLhWocpvM/MybN7EH3Szautuu3wGe ILx+PpGb4WnjOSYEFg8GEOkSpXn5K8yJyPOXX4TFCJhLI4cHeT0PuYGAvyc055Jab8gPIqWx/7ZxJ o8qTnAHw==; Received: from authenticated user by zero.zsh.org with local id 1n5dJF-0005sd-AU; Fri, 07 Jan 2022 00:40:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f48.google.com ([209.85.167.48]:45692) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1n5dIQ-0005At-M4; Fri, 07 Jan 2022 00:39:55 +0000 Received: by mail-lf1-f48.google.com with SMTP id u13so9662367lff.12 for ; Thu, 06 Jan 2022 16:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:reply-to:from:date:message-id:subject:to; bh=Oj5rV8Xo2Rn53QYyZ4/JM0VpCW4yxfBf5XQNx7A5zIM=; b=onKk3kJ/HAdmsYtkdKWW3aIN01n8xq8+NLwvG1i1X7f+87PzVOak4amQyYHTNtC4KO ysVZiYRVn/k40foR+EVdg5acJH5Y+LqoBOKSgUH4fx95BKRF/V1uhQsbvn1MdbcWVkWq 86m5cjzn+d53+CmGyrHDAJicC9W5frjKZE2/LbC+WkM87poa46yKDryFLGHUu253Rjg/ AQ5F27Oiq8EYyU3fk8mfzAdLDEIm57G14fPRzl2W9ticHQOx1vypfIHo0XU5JdB9J2zC ASD1uu+d+NalQgHN8OtaFPsZYQrgp9dviRHw/wjnmh2bzg0aNbpDgGeubTRj4DHvT5Dm PhHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=Oj5rV8Xo2Rn53QYyZ4/JM0VpCW4yxfBf5XQNx7A5zIM=; b=tp2jHcE5Wx6wuYvD6UaZEWyeADqO9roJ+GS4Je0exBdPVUlswU0jVJeQZBIt4GHwv8 /EB17DYJOhnq1sUMcedStsviOfu2eo4rRrqScqCEWBbEIV4vjVTL3xIWcvRaWcbyE/Hb 3Lqe2FXr1at3Fu9Mf4lzJyHLUEGv3fWOeWPbEgUowL4YAGBQqsRbFAIGsfghCgDfl0rS sgbWpJfsrVWf9YBMmo0hAJfVSzTuWxJpR/c4zsN0CpYbC5OJB9AI3z+dUrY9gyiXF4WO ouWQc9KzwGSn86XOKG/SIFYt2880h22Gkt8EvuLYAGhBwWhHlxOHc4VVwy21RCQDBjTx wonA== X-Gm-Message-State: AOAM531N69y4ReXTpwU08XFElzNJfo8RJ5DkOwysb+EYMbzvr05PbVAK gRrWdHW9mX0lQ6thP5zIPIiJdqXA8NT3vy2frx9Uhz9C3BNEyQ== X-Google-Smtp-Source: ABdhPJxGvrbnXAz9xNVDSH2CDfrQjNJScc27oeOKmmFZ+skAvLraCtzpcpj0bRzYOoi7uhrCgDhFVtQ05lgaHtF2jCs= X-Received: by 2002:ac2:5a43:: with SMTP id r3mr369348lfn.357.1641515993407; Thu, 06 Jan 2022 16:39:53 -0800 (PST) MIME-Version: 1.0 Reply-To: linuxtechguy@gmail.com From: Jim Date: Thu, 6 Jan 2022 18:39:35 -0600 Message-ID: Subject: Possible inconsistency with use of TZ to change zone output '%Z" To: zsh Content-Type: multipart/alternative; boundary="000000000000ae252305d4f33908" X-Seq: 27456 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000ae252305d4f33908 Content-Type: text/plain; charset="UTF-8" 1) using parameter expansion flag '%' 2) zsh/stat module 3) zsh/datetime module - strftime TZ=UTC in all cases All methods in outputting a time string appear to use strftime. zsh/stat doesn't say so in man page, but uses the same formatting. TZ is not treated the same way in all three uses. Parameter expansion and zstat need TZ to be exported to give the correct result. Whereas strftime does not. 1) Using parameter expansion flag '%' to get current date/time module zsh/datetime loaded Yes DT=${(%):-%D{%Y-%m-%d_%H:%M:%S.%N_%Z}} TZ exported NOT 2022-01-06_17:08:34.957909030_CST TZ exported Yes 2022-01-06_23:08:34.958007858_UTC module zsh/datetime loaded NOT DT=${(%):-%D{%Y-%m-%d_%H:%M:%S.%N_%Z} TZ exported NOT 2022-01-06_17:08:34.958192556_CST TZ exported Yes 2022-01-06_23:08:34.958318194_UTC 2) Output from zstat: TZ exported NOT 2021-07-25_13:53:11.000000000_CDT TZ exported Yes 2021-07-25_18:53:11.000000000_UTC 3) Output from strftime: TZ exported NOT 2021-07-25_18:53:11.000000000_UTC TZ exported Yes 2021-07-25_18:53:11.000000000_UTC Can anyone tell me why TZ needs to be exported for 1 and 2, but not 3? Personally I prefer not to have to export TZ to get the desired result, but that's just me. I don't know the reasoning with each. Thank in advance for any info you can offer, Jim --000000000000ae252305d4f33908 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
1) using parameter expansion flag '%'
2) zsh/stat module
3) zsh/datetime module - strftime

TZ=3DUTC in all cases

All meth= ods in outputting a time string appear to use strftime. zsh/stat
= doesn't say so in man page, but uses the same formatting.
TZ is not treated the same way in all three uses. Parameter exp= ansion
and zstat need TZ to be exported to give the correct resul= t. Whereas
strftime does not.

1) Using parameter expansion flag '%' t= o get current date/time
module zsh/datetime =C2=A0loaded Yes =C2=A0DT=3D= ${(%):-%D{%Y-%m-%d_%H:%M:%S.%N_%Z}}
TZ exported NOT =C2=A02022-01-06_17:08:34.957909030_CST
= TZ exported Yes =C2=A02022-01-06_23:08:34.958007858_UTC

module zsh/d= atetime =C2=A0loaded NOT =C2=A0DT=3D${(%):-%D{%Y-%m-%d_%H:%M:%S.%N_%Z}
T= Z exported NOT =C2=A02022-01-06_17:08:34.958192556_CST
TZ exported Yes = =C2=A02022-01-06_23:08:34.958318194_UTC

2) Output from zstat: =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
TZ exported NOT =C2=A02021-0= 7-25_13:53:11.000000000_CDT
TZ exported Yes =C2=A02021-07-25_18:53:11.00= 0000000_UTC

3) Output from strftime:
TZ exported NOT =C2=A02021-0= 7-25_18:53:11.000000000_UTC
TZ exported Yes =C2=A02021-07-25_18:53:11.00= 0000000_UTC

Can anyone tell me why TZ needs to be exported for 1 and 2, but no= t 3?
Personally I prefer not to have to export TZ to= get the desired result,
but that's just me. = I don't know the reasoning= with each.
<= span style=3D"font-family:arial,sans-serif">
Thank in advance for any info you can offer,
=
= Jim
--000000000000ae252305d4f33908--