I am using windows 10 OS excel 13 so in the below code 1
should return 1/1/1900
right ? below it doesn\'t why.
On this question OP pas
It is just the worksheet itself. Or to be correct: The worksheet-functionality!
Quick test:
?cdate(1)
1899-12-31
?format(1,"YYYY-MM-DD")
1899-12-31
?worksheetfunction.Text(1,"YYYY-MM-DD")
1900-01-01
But going for todays date does not show this gap:
?clng(now)
42463
?worksheetfunction.Text(now,"0")
42463
That shows that somewhere between 1 and 42463 is a gap (the quick lotus check shows it:
?cdate(60) & " --- " & cdate(61)
1900-02-28 --- 1900-03-01
?format(60,"YYYY-MM-DD") & " --- " & format(61,"YYYY-MM-DD")
1900-02-28 --- 1900-03-01
?worksheetfunction.Text(60,"YYYY-MM-DD") & " --- " & worksheetfunction.Text(61,"YYYY-MM-DD")
1900-02-29 --- 1900-03-01
Just one last test to show it again:
?format("1900-02-28","0") & " --- " & format("1900-03-01","0")
60 --- 61
?worksheetfunction.Text("1900-02-28","0") & " --- " & worksheetfunction.Text("1900-03-01","0")
59 --- 61
starting with 61, there is simply now difference in numbers. But the Lotus-Bug adds the 1900-02-29 for "compatibility".
Also: that is a "feature" for excel and has nothing to do with basic, vbscript, vba.......... All other programs work in the correct way and it would get lots of trouble if VBA would not. So for "compatibility" the VBA in excel just does it in the correct way ;)