c# - sort binary datetime -


just quickie, stored binary datetime database. binary value from

datetime dtnow = datetime.now; long lgnow = dtnow.tobinary(); 

my question is, can use these binary (long) values sorting?

thanks!

no. binary value returned tobinary has int64 type, not semantically int64; contains packed fields. sorting these values not guaranteed sort underlying dates in chronological order.

ref: https://msdn.microsoft.com/en-us/library/system.datetime.tobinary%28v=vs.110%29.aspx