Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Date and Time Properties in Entity Framework

The example below illustrates how to implement Date and Time Properties in an Entity Framework Code-First class.

public DateTime DateTimeProperty { get; set; }
public DateTime? DateTimeNullableProperty { get; set; }
public TimeSpan TimeSpanProperty { get; set; }