Freigeben über


DbFunctions.CreateDateTimeOffset-Methode

[Diese Seite bezieht sich auf Entity Framework Version 6. Die neueste Version ist als 'Entity Framework' NuGet-Paket verfügbar. Weitere Informationen zu Entity Framework finden Sie unter msdn.com/data/ef.]

Wenn sie als Teil einer LINQ to Entities-Abfrage verwendet wird, ruft diese Methode die kanonische "CreateDateTimeOffset"-EDM-Funktion auf, um ein neues DateTimeOffset-Objekt zu erstellen.

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

Syntax

'Declaration
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "day")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "hour")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "month")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "year")> _
<DbFunctionAttribute("Edm", "CreateDateTimeOffset")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "minute")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "timeZoneOffset")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "second")> _
Public Shared Function CreateDateTimeOffset ( _
    year As Nullable(Of Integer), _
    month As Nullable(Of Integer), _
    day As Nullable(Of Integer), _
    hour As Nullable(Of Integer), _
    minute As Nullable(Of Integer), _
    second As Nullable(Of Double), _
    timeZoneOffset As Nullable(Of Integer) _
) As Nullable(Of DateTimeOffset)
'Usage
Dim year As Nullable(Of Integer)
Dim month As Nullable(Of Integer)
Dim day As Nullable(Of Integer)
Dim hour As Nullable(Of Integer)
Dim minute As Nullable(Of Integer)
Dim second As Nullable(Of Double)
Dim timeZoneOffset As Nullable(Of Integer)
Dim returnValue As Nullable(Of DateTimeOffset)

returnValue = DbFunctions.CreateDateTimeOffset(year, _
    month, day, hour, minute, second, timeZoneOffset)
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "day")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hour")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "month")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "year")]
[DbFunctionAttribute("Edm", "CreateDateTimeOffset")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "minute")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeZoneOffset")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second")]
public static Nullable<DateTimeOffset> CreateDateTimeOffset(
    Nullable<int> year,
    Nullable<int> month,
    Nullable<int> day,
    Nullable<int> hour,
    Nullable<int> minute,
    Nullable<double> second,
    Nullable<int> timeZoneOffset
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"day")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"hour")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"month")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"year")]
[DbFunctionAttribute(L"Edm", L"CreateDateTimeOffset")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"minute")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"timeZoneOffset")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"second")]
public:
static Nullable<DateTimeOffset> CreateDateTimeOffset(
    Nullable<int> year, 
    Nullable<int> month, 
    Nullable<int> day, 
    Nullable<int> hour, 
    Nullable<int> minute, 
    Nullable<double> second, 
    Nullable<int> timeZoneOffset
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "day")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "hour")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "month")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "year")>]
[<DbFunctionAttribute("Edm", "CreateDateTimeOffset")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "minute")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "timeZoneOffset")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second")>]
static member CreateDateTimeOffset : 
        year:Nullable<int> * 
        month:Nullable<int> * 
        day:Nullable<int> * 
        hour:Nullable<int> * 
        minute:Nullable<int> * 
        second:Nullable<float> * 
        timeZoneOffset:Nullable<int> -> Nullable<DateTimeOffset> 
public static function CreateDateTimeOffset(
    year : Nullable<int>, 
    month : Nullable<int>, 
    day : Nullable<int>, 
    hour : Nullable<int>, 
    minute : Nullable<int>, 
    second : Nullable<double>, 
    timeZoneOffset : Nullable<int>
) : Nullable<DateTimeOffset>

Parameter

  • second
    Typ: System.Nullable<Double>
    Die Sekunden, bei Bedarf einschließlich der Bruchteile von Sekunden.

Rückgabewert

Typ: System.Nullable<DateTimeOffset>
Das neue Datum/die neue Uhrzeit.

Hinweise

Sie können diese Funktion nicht direkt aufrufen. Diese Funktion kann nur innerhalb einer LINQ to Entities-Abfrage vorkommen. Diese Funktion wird in eine entsprechende Funktion in der Datenbank übersetzt.

Siehe auch

Verweis

DbFunctions Klasse

System.Data.Entity-Namespace