Toon posts:

[VB6] Kalender bug van microsoft? *

Pagina: 1
Acties:

Verwijderd

Topicstarter
Naar aanleiding van een opmerking op mijn planningsprogramma van een collega van mij kwam ik op een hele gekke fout terrecht is Visual Basic.

Stel, een datum omzetten naar een weeknummer gaat met de code "ww". Dus de volgende instructie laat de week zien;

msgbox format$(cdate("01-01-2005"),"ww")

Deze instructie klopt, want er komt weeknummer 1 uit. Feitelijk is dit in een kalender een dubbele weeknummer (eg 53/1). Maar vul je voor de datum 03-01-2005 in dan komt week 2 eruit. Logies, maar als je een willekeurige kalender bekijkt dan staat er dat 3 Januari in Week 1 van 2005 valt.

Is dit een bug van Microsoft in Visual Basic of kloppen de kalenders van tegenwoordig niet meer? :o

Ps De datumnotatie maakt geen verschil of dit nu Europees is of Amerikaans/Engels. O-)

Enkele voorbeelden van internet:
http://www.startpagina.nl/ov/kalender.htm
http://www.onlineagenda.n...rzicht.asp?datum=4-1-2005

  • Jerry
  • Registratie: September 2001
  • Laatst online: 24-03 16:08

Jerry

Who?

Idd vaag, maar in Windows geeft ie het ook als week 2 aan :?

Afbeeldingslocatie: http://www.xs4all.nl/~vanstoel/images/tijd.jpg

Oh ja, stom niet aan gedacht :X (zie post onder)

[ Voor 54% gewijzigd door Jerry op 30-11-2004 19:35 ]


  • pasta
  • Registratie: September 2002
  • Laatst online: 04-04 23:18

pasta

Ondertitel

Mjah, volgens Microsoft begint een nieuwe week op Zondag. Dat valt dus ook te zien in je kalender. Die dubbele week is dus maar enkele dagen (of zelfs een dag). :)

Signature


Verwijderd

Topicstarter
Never mind

[ Voor 84% gewijzigd door Verwijderd op 30-11-2004 21:52 ]


Verwijderd

voor europa geld een bepaalde iso (ISO 8601) voor datum/tijd zaken, dit is wat er beschreven wordt voor weeknr's:
Bron: http://www.cl.cam.ac.uk/~mgk25/iso-time.html
In commercial and industrial applications (delivery times, production plans, etc.), especially in Europe, it is often required to refer to a week of a year. Week 01 of a year is per definition the first week that has the Thursday in this year, which is equivalent to the week that contains the fourth day of January. In other words, the first week of a new year is the week that has the majority of its days in the new year. Week 01 might also contain days from the previous year and the week before week 01 of a year is the last week (52 or 53) of the previous year even if it contains days from the new year. A week starts with Monday (day 1) and ends with Sunday (day 7). For example, the first week of the year 1997 lasts from 1996-12-30 to 1997-01-05 and can be written in standard notation as .........
Dus het lijkt dat microsoft het hier fout heeft.

  • farlane
  • Registratie: Maart 2000
  • Laatst online: 17-05 17:19
Verwijderd schreef op dinsdag 30 november 2004 @ 19:20:

msgbox format$(cdate("01-01-2005"),"ww")
Gebruik eens vbFirstFourDays, en vbMonday als firstday als opties dan.

Somniferous whisperings of scarlet fields. Sleep calling me and in my dreams i wander. My reality is abandoned (I traverse afar). Not a care if I never everwake.

Pagina: 1