Michael,
Yes, you are right. Covert class doesn't work for DateTime. The reason being
is the IConvertibe methods throw InvalidCast exception. However in case
where you use .NET 2.0 the DateTime clas there support methods ToBinary and
FromBinary that converts to *long* and from *long*. Interestingly
IConvertible.ToInt64 still throws the exception.
--
HTH
Stoitcho Goutsev (100)
"Michel Racicot" <mr******@hotmail.com> wrote in message
news:es***************@tk2msftngp13.phx.gbl...
I've tried this... And you can't convert a DateTime to Int64 (There is no
implicit conversion between the two types as it is possible in other
language/frameworks such as Delphi's VCL)
"Stoitcho Goutsev (100)" <10*@100.com> wrote in message
news:u0**************@TK2MSFTNGP11.phx.gbl... Michael,
You can use the Convert class . It provides methods Convert.ToInt64 and
Convert.ToDateTime
--
HTH
Stoitcho Goutsev (100)
"Michel Racicot" <mr******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...I need to put a DateTime variable in a MemoryStream via a StreamWriter.
Is there a way to convert the DateTime object into another data type
(UInt64 for exemple?)
Or is there an easy way to put it in my memory stream?
Thank You