PC Review


Reply
 
 
=?Utf-8?B?amVmZg==?=
Guest
Posts: n/a
 
      3rd Mar 2007
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
 
 
 
 
Neil Cowburn
Guest
Posts: n/a
 
      6th Mar 2007
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" <(E-Mail Removed)> wrote in message
news:A7692322-3E88-4186-BF8D-(E-Mail Removed)...
> 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
 
Nino Benvenuti
Guest
Posts: n/a
 
      6th Mar 2007

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" <(E-Mail Removed)> wrote in message
newsC3D756E-D54C-4EC2-B82F-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:A7692322-3E88-4186-BF8D-(E-Mail Removed)...
>> 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: DateIssue =?Utf-8?B?amVmZg==?= Microsoft Dot NET Compact Framework 0 2nd Mar 2007 11:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:22 PM.