PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework DateIssue

Reply

DateIssue

 
Thread Tools Rate Thread
Old 02-03-2007, 11:35 PM   #1
=?Utf-8?B?amVmZg==?=
Guest
 
Posts: n/a
Default DateIssue


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
  Reply With Quote
Old 06-03-2007, 05:44 PM   #2
Neil Cowburn
Guest
 
Posts: n/a
Default Re: DateIssue

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


  Reply With Quote
Old 06-03-2007, 06:34 PM   #3
Nino Benvenuti
Guest
 
Posts: n/a
Default Re: DateIssue


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
newsC3D756E-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

>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off