Udostępnij za pośrednictwem


DateTimeOffset (EDM)

In the Entity Data Model (EDM), the DateTimeOffset type represents an interval of time that can be added to or subtracted from an instance of the DateTime type.

EDM Canonical Functions and DateTime types

EDM Promotion Rules are sufficient to determine the following CLR -> Canonical -> Store function mappings.

CLR Canonical Function Storage Function SQL Server 2008 Storage Function SQL Server 2005

DateTime.Year

Int Year(DateTime)

Not supported

Not supported

Not supported

DatePart(YEAR, date)

DatePart(YEAR, date)

Not supported

DateTimeOffset.Year

Int Year(DateTimeOffset)

Not supported

Not supported

DateTime.Month

Int Month(DateTime)

DatePart(MONTH, date)

DatePart(MONTH, date)

DateTimeOffset.Year

Int Month(DateTimeOffset)

Not supported

Not supported

DateTime.Day

Int Day(DateTime)

DatePart(DAY, date)

DatePart(DAY, date)

DateTimeOffset.Day

Int Day(DateTimeOffset)

Not supported

Not supported

DateTime.Hour

Int Hour(DateTime)

DatePart(HOUR, date)

DatePart(HOUR, date)

DateTimeOffset.Hour

Int Hour(DateTimeOffset)

Not supported

Not supported

Timespan.Hours

Int Hour(Time)

Not supported

Not supported

DateTime.Minute

Int Minute(DateTime)

DatePart(MINUTE, date)

DatePart(MINUTE, date)

DateTimeOffset.Minute

Int Minute(DateTimeOffset)

Not supported

Not supported

Timespan.Minutes

Int Minute(Time)

Not supported

Not supported

DateTime.Second

Int Second(DateTime)

DatePart(SECOND, date)

DatePart(SECOND, date)

DateTimeOffset.Second

Int Second(DateTimeOffset)

Not supported

Not supported

Timespan.Seconds

Int Second(Time)

Not supported

Not supported

DateTime.Millisecond

Int Millisecond(DateTime)

DatePart(MILLISECOND, date)

DatePart(MILLISECOND, date)

DateTimeOffset.Millisecond

Int Millisecond(DateTimeOffset)

Not supported

Not supported

Timespan.Milliseconds

Int Millisecond(Time)

Not supported

Not supported

Not supported

Int GetTotalOffsetMinutes(DateTimeOffset)

DatePart(TZOFFSET,date)

Not supported

DateTime.Now

CurrentDateTime()1

SysDateTime()

GetDate()

DateTimeOffset.Now

CurrentDateTimeOffset()

SysDateTimeOffset()

Not supported

DateTime.UtcNow

CurrentUtcDateTime()

SysUtcDateTime()

GetUtcDate()

See Also

Concepts

DateTime (EDM)