Is date/time part of SQL Server's datetimeoffset UTC or local?

According to Microsoft's page on the datetimeoffset data type (see here):

A time zone offset specifies the zone offset from UTC for a time or datetime value.

But nowhere does it say whether the datetime part of the datetimeoffset string literal format is showing either:

  • UTC time, with the timezone offset being what to apply to that time to get to localtime, or;
  • localtime, with the timezone offset being what to apply to that time to get back to UTC.

This is the string literal format for datetimeoffset: YYYY-MM-DD hh:mm:ss[.nnnnnnn] [{+|-}hh:mm].

My question therefore is, is the YYYY-MM-DD hh:mm:ss[.nnnnnnn] bit of that string literal in localtime or in UTC?

Answers


The YYY-MM-DD hh:mm:ss[.nnnnnnn] [{+|-}hh:mm] format is an ISO8601 format. The ISO page gives

Coordinated universal time (UTC) Local time with offset to UTC

As this format has the offset then the base time is local. See wikipedia for other examples.


Need Your Help

Can't see Mailchimp IP addresses

mailchimp

I need the IP addresses of Mailchimp to send it to our IT provider but is it correct there aren't any on this page? The link is here: http://mailchimp.com/about/ips/

Why do I need 6 backslashes to search one backslace with LIKE in MySQL?

mysql

First, I know that searching with LIKE equals a double unescape for MySQL, this is why we need \\\\ to LIKE one \.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.