Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!uokmax!munnari.oz.au!mel.dit.csiro.au!yarra!melba.bby.oz.au!leo!zvs From: zvs@bby.oz.au (Zev Sero) Newsgroups: comp.std.c Subject: Re: lots of questions about strftime() Message-ID: <1990Aug16.025910.25526@melba.bby.oz.au> Date: 16 Aug 90 02:59:10 GMT References: <496@mtndew.Tustin.CA.US> Sender: news@melba.bby.oz.au Organization: Burdett, Buckeridge and Young Ltd. Lines: 22 In-Reply-To: friedl@mtndew.Tustin.CA.US's message of 13 Aug 90 07:05:47 GMT In article <496@mtndew.Tustin.CA.US> friedl@mtndew.Tustin.CA.US (Steve Friedl) writes: %U - the week number of the year (with the first Sunday being the start of week 1) as a decimal number (00-53) The Sunday after 1st January is the beginning of week 01. This makes a difference when the year begins on a Sunday. %W - the week number of the year (with the first Monday being the start of week 1) as a decimal number (00-53) Ditto. U_weekno = (yday + (7 - (7000 + yday - wday) % 7)) / 7; W_weekno = (yday + (7 - (7001 + yday - wday) % 7)) / 7; U_weekno = (6 + yday - wday) / 7; W_weekno = (6 + yday - (wday ? wday - 1 : 6)) / 7; -- Zev Sero - zvs@bby.oz.au Violence is not a pleasant thing. It has caused much suffering in the world since its invention, and many are convinced that it is Quite A Bad Thing. - Steven Megachiropter Foster