Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Possible bug?



Mike Perez wrote:
>Well I am not sure if this is a bug or not, but I was able to reproduce
>it on a few machines that all were in Y2K.

I can reproduce it too:

% date
Sun Jan  2 00:48:08 GMT 2000
% print -P '%D{%G}'
1999
% date +%G
1999
% date +%Y
2000
% print -P '%D{%Y}'
2000

What is %G, anyway?  It's not one of the zsh extensions; it's just being
handled by the native strftime(3).  My strftime(3) doesn't document %G,
and I don't have its source handy.  I expect that %G is the year part
of the week specification for the current week; today is 1999-W52-7,
and 2000-W01 starts tomorrow (2000-01-03 == 2000-W01-1).  Ah, look:

% date -d tomorrow
Mon Jan  3 00:52:44 GMT 2000
% date -d tomorrow +%G
2000

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author