Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Sep 1997 19:28:32 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>
Cc:        wollman@khavrinen.lcs.mit.edu (Garrett Wollman), current@FreeBSD.ORG
Subject:   Re: Adding algorithms [Was: cvs commit: src/usr.bin/cksum crc32.c ...]
Message-ID:  <199709292328.TAA13519@khavrinen.lcs.mit.edu>
In-Reply-To: <199709292147.XAA05359@rvc1.informatik.ba-stuttgart.de>
References:  <199709281357.JAA08605@khavrinen.lcs.mit.edu> <199709292147.XAA05359@rvc1.informatik.ba-stuttgart.de>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 29 Sep 1997 23:47:32 +0200 (MET DST), Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE> said:

>> ISO 8601.  The strftime(3) function already provides this
>> functionality, although there is unfortunately no direct
>> iso8601weeknumber() function to give you the integer value directly.

> Unfortunately strftime(3)'s notion of week number only comes close
> to DIN 1355:

> [ISO 9899 quotation deleted]

UTSL.

			case 'V':
				/*
				** From Arnold Robbins' strftime version 3.0:
				** "the week number of the year (the first
				** Monday as the first day of week 1) as a
				** decimal number (01-53).  The method for
				** determining the week number is as specified
				** by ISO 8601 (to wit: if the week containing
				** January 1 has four or more days in the new
				** year, then it is week 1, otherwise it is
				** week 53 of the previous year and the next
				** week is week 1)."
				** (ado, 5/24/93)
				*/
				/*
				** XXX--If January 1 falls on a Friday,
				** January 1-3 are part of week 53 of the
				** previous year.  By analogy, if January
				** 1 falls on a Thursday, are December 29-31
				** of the PREVIOUS year part of week 1???
				** (ado 5/24/93)
				*/
				/*
				** You are understood not to expect this.
				*/
				{
					int	i;

I believe that more recent versions of this code also provide a
conversion to match the ISO 8601 year-of-week, but our current version
doesn't.  (I once made a stab at updating ours, but the locale code
has changed too much.)

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709292328.TAA13519>