delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/26/19:16:12

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: strftime: Need Help with Time Offsets
Date: Tue, 26 Dec 2000 23:36:05 +0000
Organization: Customer of Energis Squared
Lines: 27
Message-ID: <419i4tsoc9dgtbp9okme2cghdn09uocgq4@4ax.com>
References: <1a524t0tk28cmv3vqfq26tooe0qeikhgm5 AT 4ax DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1001221110346 DOT 28580O-100000 AT is> <ku454tke181c70f6rimuamfd2pc9p0blfk AT 4ax DOT com> <2561-Fri22Dec2000120234+0200-eliz AT is DOT elta DOT co DOT il> <pki64tssb5jku2tjnqg3ch5oqr5ngevntk AT 4ax DOT com> <1190-Fri22Dec2000173248+0200-eliz AT is DOT elta DOT co DOT il> <0nt94tkh5ptfohe9414da1u3geja7ml4vm AT 4ax DOT com> <20001226124727 DOT A19514 AT kendall DOT sfbr DOT org>
NNTP-Posting-Host: modem-121.magnesium.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news5.svr.pol.co.uk 977873789 24376 62.136.11.121 (26 Dec 2000 23:36:29 GMT)
NNTP-Posting-Date: 26 Dec 2000 23:36:29 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

JT Williams <jeffw AT darwin DOT sfbr DOT org> wrote:

> -: If someone has the time to figure out the calculation for week numbers
> -: (%V) from any supplied date, that would help.
> 
> Take a look in "Astronomical Algorithms", by Jean Meeus.

Erm, the week no's required for strftime() have nothing to do with the
position of the planets. ;-)

(IOW, If that reference is appropriate please can you expand it.)

This is what needs to be figured out:

: In this system, weeks begin on a Monday and week 1 of the year is the   
: week that includes January 4th, which is also the week that includes   
: the first Thursday of the year, and is also the first week that   
: contains at least four days in the year.  If the first Monday of   
: January is the 2nd, 3rd, or 4th, the preceding days are part of the  
: last week of the preceding year; thus, for Saturday 2nd January 1999,  
: %G is replaced by 1998 and %V is replaced by 53.  If December 29th,  
: 30th, or 31st is a Monday, it and any following days are part of week  
: 1 of the following year.  Thus, for Tuesday 30th December 1997, %G is  
: replaced by 1998 and %V is replaced by 1. 

The week number, %V as defined above, needs to be calculated from the
date fields of a struct tm.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019