Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:47:03+00:00 2026-06-08T21:47:03+00:00

According to this MSDN article : The optional time zone indicator, Z, is used

  • 0

According to this MSDN article:

“The optional time zone indicator, Z, is used to make it easier to map XML datetime values that have time zone information to SQL Server datetime values that have no time zone. Z is the indicator for time zone UTC-0. Other time zones are indicated with HH:MM offset in the + or – direction. For example: 2006-12-12T23:45:12-08:00.”

But when I run:

declare @d datetime;
set @d=getdate();
print CONVERT(varchar(40), @d, 127)

the result is 2012-07-31T14:04:11.447. No time zone part. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:47:05+00:00Added an answer on June 8, 2026 at 9:47 pm

    The DateTime type doesn’t include a time zone, and the GETDATE() function returns a DateTime.

    Instead, you need to use SQL Server’s DateTimeOffset type, which was introduced in SQL Server 2008. That would make your example:

    declare @d datetimeoffset;
    set @d=sysdatetimeoffset();
    print CONVERT(varchar(40), @d, 127)
    

    Note the use of the SYSDATETIMEOFFSET() function.

    That said, what are you actually trying to achieve, in practice? If you have some actual timezoneless data (e.g. data in a DateTime column) from which you’re trying to extract the time zone, that’s going to be tricky.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According this MSDN article HttpApplication .EndRequest can be used to close or dispose of
According to this MSDN article about medium trust , under medium-trust: FileIOPermission is restricted.
I implement this function : GetSystemPowerStatusEx & GetSystemPowerStatusEx2 according to this article on MSDN
According to this article, http://msdn.microsoft.com/en-us/library/ms177197.aspx on MSDN, we should release the unmanaged resources in
According to this http://msdn.microsoft.com/en-us/library/cc849094(v=vs.85).aspx#OptInHighDPI you can make your web browser control use IE8-style zooming,
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
I didnt find anything according this issue. Can jaas be used to secure my
According to this article , it says: Use a delegate in the following circumstances:
According to this MSDN page : WOW64 enables 32-bit applications to take advantage of
According to this page on MSDN, the Key Value for Left Control is 162.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.