PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
DateIssue
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
DateIssue
![]() |
DateIssue |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi Guys,
I have create a Date Object, with my specified date. let me see: DateTime dt = new DateTime(2007,03,03,07,30,00); and I get the long ticks = dt.Ticks; however when I create another DateTime instance by using that ticks, DateTime clone = new DateTime(ticks); It only return me year,month,day, the hour has been changed 12,and min is 00, what is the issue? Thanks |
|
|
|
#2 |
|
Guest
Posts: n/a
|
I've just tried to verify this and I get the correct result, unlike the OP.
Here's my code: using System; static class Program { [MTAThread] static void Main() { DateTime dt = new DateTime(2007, 03, 03, 07, 30, 00); long ticks = dt.Ticks; DateTime clone = new DateTime(ticks); string parsed = clone.ToString(); } // Set BP here so that you can inspect 'parsed' } -- Neil Cowburn Principal Partner OpenNETCF Consulting, LLC. Managed Code in the Embedded World http://www.opennetcf.com/ http://www.smartdeviceframework.com/ "jeff" <jeff@discussions.microsoft.com> wrote in message news:A7692322-3E88-4186-BF8D-232CF42CB203@microsoft.com... > Hi Guys, > > I have create a Date Object, with my specified date. > let me see: > > DateTime dt = new DateTime(2007,03,03,07,30,00); > and I get the long ticks = dt.Ticks; > however when I create another DateTime instance by using that ticks, > DateTime clone = new DateTime(ticks); > > It only return me year,month,day, the hour has been changed 12,and min is > 00, > > what is the issue? > > Thanks |
|
|
|
#3 |
|
Guest
Posts: n/a
|
I tried Neil's code and received the correct result as well. For the OP: On what platform and with which version of CF did you experience the issue? -- Nino Benvenuti Device Application Development MVP http://nino.net/blog "Neil Cowburn" <neilc@nospam.opennetcf.com> wrote in message news C3D756E-D54C-4EC2-B82F-06C256EF0502@microsoft.com...> I've just tried to verify this and I get the correct result, unlike the > OP. > > Here's my code: > > using System; > > static class Program > { > [MTAThread] > static void Main() > { > DateTime dt = new DateTime(2007, 03, 03, 07, 30, 00); > long ticks = dt.Ticks; > > DateTime clone = new DateTime(ticks); > string parsed = clone.ToString(); > } // Set BP here so that you can inspect 'parsed' > } > > -- > Neil Cowburn > Principal Partner > OpenNETCF Consulting, LLC. > > Managed Code in the Embedded World > > http://www.opennetcf.com/ > http://www.smartdeviceframework.com/ > > > "jeff" <jeff@discussions.microsoft.com> wrote in message > news:A7692322-3E88-4186-BF8D-232CF42CB203@microsoft.com... >> Hi Guys, >> >> I have create a Date Object, with my specified date. >> let me see: >> >> DateTime dt = new DateTime(2007,03,03,07,30,00); >> and I get the long ticks = dt.Ticks; >> however when I create another DateTime instance by using that ticks, >> DateTime clone = new DateTime(ticks); >> >> It only return me year,month,day, the hour has been changed 12,and min is >> 00, >> >> what is the issue? >> >> Thanks > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

C3D756E-D54C-4EC2-B82F-06C256EF0502@microsoft.com...
