DbFunctions.TruncateTime Method (Nullable<DateTime>)

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

When used as part of a LINQ to Entities query, this method invokes the canonical TruncateTime EDM function to return the given date with the time portion cleared.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "dateValue")]
[DbFunctionAttribute("Edm", "TruncateTime")]
public static Nullable<DateTime> TruncateTime(
	Nullable<DateTime> dateValue


Type: System.Nullable<DateTime>
The date/time value to use.

Return Value

Type: System.Nullable<DateTime>
The input date with the time portion cleared.

You cannot call this function directly. This function can only appear within a LINQ to Entities query. This function is translated to a corresponding function in the database.