3

I'm entering a datetime using the entity framework and I was trying to enter this date:

new DateTime(2011, 11, 18, 23, 59, 59, 999);

which is one millisecond before the 19th.

However when I check it in the database it keeps getting rounded up to the 19th 2011/11/19 0 0 0 000

Anyone know what's going on here and how to remedy it?

This is the type in my model:

public override DateTime? EndDate { get; set; }
AnonyMouse
  • 18,108
  • 26
  • 79
  • 131

1 Answers1

1

May be your column type on database is date? not datetime

Reza ArabQaeni
  • 4,848
  • 27
  • 46