DbFunctions.TruncateTime Method

 

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)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticTruncateTime(Nullable<DateTime>)

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.

System_CAPS_pubmethodSystem_CAPS_staticTruncateTime(Nullable<DateTimeOffset>)

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.


DbFunctions.TruncateTime Method (Nullable<DateTime>)

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.

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

Parameters

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.


DbFunctions.TruncateTime Method (Nullable<DateTimeOffset>)

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.

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

Parameters

dateValue
Type: System.Nullable<DateTimeOffset>

The date/time value to use.

Return Value

Type: System.Nullable<DateTimeOffset>

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.