471,330 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

DateTime to byte[]

How do I convert a DateTime to a byte array? BitConverter does not take a
DateTime.
Jun 27 '08 #1
1 8376
How do I convert a DateTime to a byte array? BitConverter does not take a
DateTime.
Well, you can use when.ToBinary() and when = DateTime.FromBinary(...) to
convert to/from a long, and use BitConverter for long to/from byte[] -
would that do?

Marc
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by andrew lowe | last post: by
3 posts views Thread by David | last post: by
3 posts views Thread by Peter Wone | last post: by
5 posts views Thread by Fabio | last post: by
6 posts views Thread by minboymike | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.