Storing a DateTime value of DateTime.MinValue in azure table storage fails

7.2k views Asked by At

I am getting an aggregated exception while storing a DateTime value of either null or DateTime.MinValue. How do I store an acceptable default DateTime value in Azure table store?

1

There are 1 answers

1
Vladimir Dorokhov On BEST ANSWER
  1. From MSDN:

Edm.DateTime DateTime A 64-bit value expressed as Coordinated Universal Time (UTC). The supported DateTime range begins from 12:00 midnight, January 1, 1601 A.D. (C.E.), UTC. The range ends at December 31, 9999.

So, the minimum .Net DateTime value you can store in Azure Tables is new DateTime(1601, 1, 1).

But DateTime.MinValue is equal to new DateTime(0001, 01, 01), that's why you can't store it.

  1. null should be ok, if your date time property type is nullable (DateTime?).