you use math !!!!!!!!!!!!!
i.e. something that someone else wrote
... you lazy guy
"Chris Tacke, MVP" <
[email protected]> a écrit dans le
message de news: (e-mail address removed)...
I'm pointing out that the solution was given. Asking for someone to
rewrite what is essentially math, and not at all complex is a bit much.
He gave you the solution, the least you could do is make the effort to
convert it to VB, then if you have trouble with some part of the
conversion come back and ask about it.
The shocker of doing that is that you might actually learn how it
works, rather than exercising your cut and paste skills.
-Chris
"RobertM" <f> wrote in message
what's wrong with you ?
"<ctacke/>" <ctacke_AT_OpenNETCF_com> a écrit dans le message de (e-mail address removed)...
http://www.danielmoth.com/Blog/2005/03/please-read-before-posting-to-ng.html
See point #11
-Chris
"RobertM" <f> wrote in message
Hi Sergey
thanks a lot but i don't understand C# code
any clue with vb code ?
regards
"Sergey Bogdanov" <
[email protected]> a ecrit dans le
message de news: (e-mail address removed)...
You can use .Ticks to get long instead of double. If you really
want to get double here you are an example:
DateTime t = DateTime.Now;
double r = TicksToOADate(t.Ticks)
...
private static double TicksToOADate(long value)
{
if (value == 0) return 0;
if (value < 0xc92a69c000)
{
value += 0x85103c0cb83c000;
}
if (value < 0x6efdddaec64000) throw new OverflowException();
long l = (value - 0x85103c0cb83c000) / ((long) 0x2710);
if (l < 0)
{
long t = l % ((long) 0x5265c00);
if (t != 0) l -= (0x5265c00 + t) * 2;
}
return ((double)l) / 86400000;
}
FYI, CF2.0 already supports ToOADate().
--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com
RobertM wrote:
Hi
I need to convert date values in double. I have noticed that the
CF 1 doesn't support the ToOADate method.
any idea to do this by code (vs2003 + vb.net + CF1.1)
regards