Redigera

Dela via


EntityFunctions.TruncateTime Method

Definition

Invokes the canonical TruncateTime function. For information about the canonical TruncateTime function, see Date and Time Canonical Functions.

Overloads

TruncateTime(Nullable<DateTime>)

Invokes the canonical TruncateTime function. For information about the canonical TruncateTime function, see Date and Time Canonical Functions.

TruncateTime(Nullable<DateTimeOffset>)

Invokes the canonical TruncateTime function. For information about the canonical TruncateTime function, see Date and Time Canonical Functions.

Remarks

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.

TruncateTime(Nullable<DateTime>)

Invokes the canonical TruncateTime function. For information about the canonical TruncateTime function, see Date and Time Canonical Functions.

public:
 static Nullable<DateTime> TruncateTime(Nullable<DateTime> dateValue);
[System.Data.Objects.DataClasses.EdmFunction("Edm", "TruncateTime")]
public static DateTime? TruncateTime (DateTime? dateValue);
[<System.Data.Objects.DataClasses.EdmFunction("Edm", "TruncateTime")>]
static member TruncateTime : Nullable<DateTime> -> Nullable<DateTime>
Public Shared Function TruncateTime (dateValue As Nullable(Of DateTime)) As Nullable(Of DateTime)

Parameters

dateValue
Nullable<DateTime>

The date to truncate.

Returns

The input date with the time portion cleared.

Attributes

Remarks

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.

Applies to

TruncateTime(Nullable<DateTimeOffset>)

Invokes the canonical TruncateTime function. For information about the canonical TruncateTime function, see Date and Time Canonical Functions.

public:
 static Nullable<DateTimeOffset> TruncateTime(Nullable<DateTimeOffset> dateValue);
[System.Data.Objects.DataClasses.EdmFunction("Edm", "TruncateTime")]
public static DateTimeOffset? TruncateTime (DateTimeOffset? dateValue);
[<System.Data.Objects.DataClasses.EdmFunction("Edm", "TruncateTime")>]
static member TruncateTime : Nullable<DateTimeOffset> -> Nullable<DateTimeOffset>
Public Shared Function TruncateTime (dateValue As Nullable(Of DateTimeOffset)) As Nullable(Of DateTimeOffset)

Parameters

dateValue
Nullable<DateTimeOffset>

The date time offset to truncate.

Returns

The input date with the time portion cleared.

Attributes

Remarks

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.

Applies to