[PATCH 2/5] ucrtbase: strftime returns 4-digit timezone for %z.

Jeff Smith whydoubt at gmail.com
Wed Nov 13 14:57:43 CST 2019

On Wed, Nov 13, 2019 at 11:30 AM Piotr Caban <piotr at codeweavers.com> wrote:
> From: Jeff Smith <whydoubt at gmail.com>
> Signed-off-by: Jeff Smith <whydoubt at gmail.com>
> Signed-off-by: Piotr Caban <piotr at codeweavers.com>
> ---
>   dlls/msvcrt/time.c         | 30 ++++++++++++++++++++++++++++++
>   dlls/ucrtbase/tests/misc.c |  6 ++++++
>   2 files changed, 36 insertions(+)

There was a subtle but important point that I failed to document in my
patch, and the re-write has it wrong.
Note that the test only checks the format of the returned string, and
not the value.

The %z format (with ucrtbase) is essentially the RFC822 time zone
format, and the sign is reversed from how the value is stored.
- If the timezone offset is negative or zero, the sign should be '+'.
- If the timezone offset is positive, the sign should be '-'.  (e.g.
CST: 21600 is stored, but %z results in "-0600")

More information about the wine-devel mailing list