Hi Andreas;

It's getting weirder.

It seems to be format based. 

On Sat, 2006-12-08 at 12:37 +0200, Andreas Saeger wrote:

> This is weird. I can't reproduce this behaviour using =N(0) and 
> auto-save with official build OOo2.0.2 on SuSE9.x.
> Why not put a plain constant zero into $A$1 ?
> 
 I had A1=N(0) and A5=N(0).  I replaced A1=0. For A1 I got unformatted
30/12/1899; formatted it showed as Sat, Dec 30, 99.  Tried F9 (recalc.)
-- no change.  Then auto-save came on, A1 changed to Fri, Dec 29, 99. 

A5 {=N(0)} had showed Fri, Dec 29, 99 continuously with no change.

The formulae I had set up (see your suggestion below) didn't change.
When I rationalized them they were correct, but working as if A1 and A5
were 30/12/1899. 

> >> Well, you need to be shure what it does:
> >> Put this into a test-sheet:
> >> A1: =TODAY() [or any other start-date]
> >> A2: =A1+1
> >> B1: =WEEKS($A$1;$A1;0)
> >> C1: =FLOOR($A1-$A$1;7)/7
> >> D1: =WEEKS($A$1;$A1;1)
> >> E1: =FLOOR($A1-$A$1+WEEKDAY($A$1;3);7)/7)
> >> [WEEKDAY(Dt;3) starts with Monday=0)]
> >> Copy down B1:E1 to row B2:E2, then copy down row 2 to a few dozends of 
> >> rows.
> >> Change A1 (add/substract some number of days)
> >> Format A, so it shows a weekday, for instance YYYY-MM-DD NN
> >> WEEK(Dt;0) gives count of complete weeks since start, WEEK(Dt;1) seems 
> >> to start counting at next Monday.
> > 
> > I re-entered the A1 =N(0) value and proceeded to input your suggested
> > table.  I set B1 to TODAY(). Row 1 values were 0; row 2 values were all
> > 5563 (number of weeks from the turn of the last century to today).  No
> > change was detected in these numbers during auto-save. But then they
> > shouldn't reflect a fraction of a week.
> >
> Your may use another table, but I used =WEEKS($A$1;$A1;0) in B1.
> A has formatted numbers, increasing by one.
> B has the 0-variant of WEEKS(thisDate-firstDate; 0), starting at 0
> C simulates B
> D has the 1-variant of WEEKS(thisDate-firstDate; 1), starting at 0
> E simulates D

Additionally:
A1 ($A$1) entered as 0, shows in the formula bar as 30/12/1899, shows in
the cell as Fri, Dec 29, 99.
I can't rationalize why D2 and E2 below should differ.

A2=TODAY() ==> Sat, Aug 12, 06
B2=WEEKS($A$1;$A2;0) ==> 5563
C2=FLOOR($A2-$A$1;1)/7 ==> 5563
D2=WEEKS($A$1;$A2;1) ==> 5563
E2=FLOOR($A2-$A$1+WEEKDAY($A$1;3);1)/7 ==> 5564
F2=N(A2) ==> 38941
G2=F2/7 ==> 5563

A3=TODAY()+2 ==> Mon, Aug 14, 06
B3=WEEKS($A$1;$A3;0) ==> 5563
C3=FLOOR($A3-$A$1;1)/7 ==> 5563
D3=WEEKS($A$1;$A3;1) ==> 5564
E3=FLOOR($A3-$A$1+WEEKDAY($A$1;3);1)/7 ==> 5564
F3=N(A3) ==> 38943
G3=F3/7 ==> 5563.29

B3 seems to show that Type=0 counts the number of weeks since start
rounded down -- i.e. 5563 *full* weeks have passed.  While D3
WEEKS(Sdt;1) shows that the End date is in the 5564th week since the
start. ??

I left my computer running all night.  This morning A1 and A5 both =N(0)
at that time, showed Sat, Dec 30, 99 as opposed to Fri, Dec 29, 99.
Since I was having the same problem then, I am positive I left them
showing the Fri date.  They are, of course, now flipped back to Fri.

That is, I keep gaining and losing a day on the display, WEEKS() doesn't
seem to be doing the proper calculation and internally OOo seems to use
30/12/1899 for date arithmetic.

The only places I can see to take this is:

1) Test my system clock outside of OOo.  How? 
2) Submit an Issue report.

Before I do anything, I want to make sure I am not double thinking
myself into a non-existent problem.  That is easy to do with date
calculations.
-- 
Regards Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to