DbFunctions.CreateDateTimeOffset (Método)
[Esta página es específica de la versión 6 de Entity Framework. La versión más reciente está disponible como el paquete NuGet de Entity Framework. Para más información sobre Entity Framework, consulte msdn.com/es-ES/data/ef].
Cuando se usa como parte de una consulta LINQ to Entities, este método invoca la función canónica CreateDateTimeOffset de EDM para crear un nuevo objeto DateTimeOffset.
Espacio de nombres: System.Data.Entity
Ensamblado: EntityFramework (en EntityFramework.dll)
Sintaxis
'Declaración
<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)
'Uso
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>
Parámetros
- year
Tipo: System.Nullable<Int32>
Año.
- month
Tipo: System.Nullable<Int32>
Mes (basado en uno).
- day
Tipo: System.Nullable<Int32>
Día (basado en uno).
- hour
Tipo: System.Nullable<Int32>
Horas.
- minute
Tipo: System.Nullable<Int32>
Minutos.
- second
Tipo: System.Nullable<Double>
Segundos, incluidas las partes fraccionarias de los segundos si se desea.
- timeZoneOffset
Tipo: System.Nullable<Int32>
Elemento de desfase de zona horaria de la nueva fecha.
Valor devuelto
Tipo: System.Nullable<DateTimeOffset>
Nueva Fecha y hora.
Comentarios
No se puede llamar directamente a esta función. Esta función solo puede aparecer dentro de una consulta LINQ to Entities. Esta función se traduce a una función correspondiente de la base de datos.