{"id":225,"date":"2006-12-27T15:35:07","date_gmt":"2006-12-27T14:35:07","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=225"},"modified":"2006-12-27T15:38:59","modified_gmt":"2006-12-27T14:38:59","slug":"sql-server-format-dates-and-times","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=225","title":{"rendered":"SQL Server format dates and times"},"content":{"rendered":"<p>DECLARE @now DATETIME  SET @now = GETDATE()    PRINT dbo.FormatDateTime(@now, &#8216;LONGDATE&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;LONGDATEANDTIME&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;SHORTDATE&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;SHORTDATEANDTIME&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;UNIXTIMESTAMP&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;YYYYMMDD&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;YYYY-MM-DD&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;YYMMDD&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;YY-MM-DD&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;MMDDYY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;MM-DD-YY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;MM\/DD\/YY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;MM\/DD\/YYYY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;DDMMYY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;DD-MM-YY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;DD\/MM\/YY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;DD\/MM\/YYYY&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;HH:MM:SS 24&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;HH:MM 24&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;HH:MM:SS 12&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;HH:MM 12&#8217;)  PRINT dbo.FormatDateTime(@now, &#8216;goofy&#8217;)<\/p>\n<p>Artigo Completo <a target=\"_blank\" title=\"http:\/\/sqlserver2000.databases.aspfaq.com\/can-i-make-sql-server-format-dates-and-times-for-me.html\" href=\"http:\/\/sqlserver2000.databases.aspfaq.com\/can-i-make-sql-server-format-dates-and-times-for-me.html\">Aqui<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DECLARE @now DATETIME SET @now = GETDATE() PRINT dbo.FormatDateTime(@now, &#8216;LONGDATE&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;LONGDATEANDTIME&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;SHORTDATE&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;SHORTDATEANDTIME&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;UNIXTIMESTAMP&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;YYYYMMDD&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;YYYY-MM-DD&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;YYMMDD&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;YY-MM-DD&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;MMDDYY&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;MM-DD-YY&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;MM\/DD\/YY&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;MM\/DD\/YYYY&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;DDMMYY&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;DD-MM-YY&#8217;) PRINT dbo.FormatDateTime(@now, &#8216;DD\/MM\/YY&#8217;) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-sql-server","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=225"}],"version-history":[{"count":0,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/225\/revisions"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}