|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help with date.addHours()code.... If anybody could give me a clue... Here's the code: dim dt1,dt2 as dateTime dt1 = new dateTime(2006,1,1,22,0,0) dt2 = dt1.addHours(3) the problem is that I get always the same date in dt1 and dt2. If I change the code to dim dt1,dt2 as dateTime dt1 = new dateTime(2006,1,1,22,0,0) dt2 = dt1 dt2 = dt2.addHours(3) I get the same results... Shouldn't dt2 get the value of 1/2/2006 01:00? Thanks a lot, Regards, Victor Hi Victor,
I can't reproduce your error. Are you sure you are reading the result = correctly? On Tue, 08 Aug 2006 00:08:00 +0200, VR <vc***@hotmail.com> wrote: > Hi all, I'm sure I'm missing something while dealing with dates in my I get> code.... If anybody could give me a clue... > > Here's the code: > > dim dt1,dt2 as dateTime > dt1 =3D new dateTime(2006,1,1,22,0,0) > dt2 =3D dt1.addHours(3) > dt1 =3D 01.01.2006 22:00:00 dt2 =3D 02.01.2006 01:00:00 > the problem is that I get always the same date in dt1 and dt2. I get> > If I change the code to > > dim dt1,dt2 as dateTime > dt1 =3D new dateTime(2006,1,1,22,0,0) > dt2 =3D dt1 > dt2 =3D dt2.addHours(3) > > I get the same results... dt1 =3D 01.01.2006 22:00:00 dt2 =3D 02.01.2006 01:00:00 > You should, and I'm pretty sure you do too> > Shouldn't dt2 get the value of 1/2/2006 01:00? -- = Happy Coding! Morten Wennevik [C# MVP] Sorry, I almost forgot the post....
Well, I really got surprised when I reboot my machine and everything went fine again. I should not say it is a framework or windows problem, I think the problem is that I have a celeron 766 + 256MB running MSDE + VS.Net, building and rebuilding the solution for 3 days without stopping or rebooting the machine.... I think my machine just do not handle this kind of load.... sorry again... Victor "Morten Wennevik" <MortenWenne***@hotmail.com> wrote in message I can't reproduce your error. Are you sure you are reading the resultnews:op.tdx96z1xklbvpo@tr024.bouvet.no... Hi Victor, correctly? On Tue, 08 Aug 2006 00:08:00 +0200, VR <vc***@hotmail.com> wrote: > Hi all, I'm sure I'm missing something while dealing with dates in my I get> code.... If anybody could give me a clue... > > Here's the code: > > dim dt1,dt2 as dateTime > dt1 = new dateTime(2006,1,1,22,0,0) > dt2 = dt1.addHours(3) > dt1 = 01.01.2006 22:00:00 dt2 = 02.01.2006 01:00:00 > the problem is that I get always the same date in dt1 and dt2. I get> > If I change the code to > > dim dt1,dt2 as dateTime > dt1 = new dateTime(2006,1,1,22,0,0) > dt2 = dt1 > dt2 = dt2.addHours(3) > > I get the same results... dt1 = 01.01.2006 22:00:00 dt2 = 02.01.2006 01:00:00 > You should, and I'm pretty sure you do too> > Shouldn't dt2 get the value of 1/2/2006 01:00? -- Happy Coding! Morten Wennevik [C# MVP] |
|||||||||||||||||||||||