Month 53 bug? (fwd)

Wim Vandeputte bunbun at reptile.rug.ac.be
Tue Dec 30 23:41:39 UTC 1997


Hi there, I found a little quirck while playing around with the Y2K 
problem. I got an apetite for overrun problems, and I was looking for 
some variations. I found out my '93 motherboard switches from 31/12/1997
to 01/01/1997. Great. :-)

Then I found this:

---------- Forwarded message ----------
Date: Wed, 31 Dec 1997 00:03:40 +0100 (MET)
From: Wim Vandeputte <bunbun at reptile.rug.ac.be>
To: Theo de Raadt <deraadt at cvs.openbsd.org>
Subject: Month 53 bug?


eh, this is weird. OpenBSD 2.2 GENERIC#81 i386

date +%W 
gives 52

date +%V
gives 53.

is *this* 53'th week of the year?

On SunOS 5.5 (Generic_103093-08 sun4d sparc SUNW,SPARCserver-1000) both 
give 52. 

On SunOS 5.5.1 (sun4u sparc SUNW,Ultra-1) %V gives 53, %W gives 52. 

On Linux, +%W gives 52, +%V gives 01


The manpage of strftime says that if the week containing Jan 1 has four 
or more days in the new year, then it is week 1. This week gives:
Thursday (1/1), Friday (2/1), Sat (3/1), Sun (4/1) = 4 days in the new year.
So date +%V should produce 1 instead of 53, right?

This must be some lib thing....

*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*-=-*
Wim Vandeputte                                       --Comfort is Treachery--
                                              --So pound the nails in tight-- 


His first reply:



More information about the tz mailing list