Time (EDM)

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

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

This type maps to the TimeSpan type in the common language runtime (CLR) and to the Time type in SQL Server.

Facets

The Time type supports one EDM simple type facet. The Precision facet indicates the degree of granularity of the Time in fractions of a second, based on the number of decimal places supported. For example a Precision of 3 means the granularity supported is milliseconds. So if the precision is 3, the minimum value for time is 0:00:00:001 and the maximum is 23:59:59.999.

EDM Canonical Functions and DateTime Types

EDM Promotion Rules are sufficient to determine the following CLR -> Canonical -> Storage function mappings:

CLR Canonical Function Store Function SQL Server 2008 Store Function SQL Server 2005

DateTime.Year

Int Year(DateTime)

Not supported

Not supported

CLR 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

CLR 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

Community Additions

Show: