Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Display Time Zone Name

Author  Topic 

sqldev6363
Yak Posting Veteran

54 Posts

Posted - 2011-10-19 : 11:12:32
hi,

I have a date field, need to display with time zone and AM/PM also.

output should be like this

Sample Result:
10/14/2011 7:05:24 AM (ET)
10/19/2011 4:50:34 AM (ET)

Can anyone help me on this, thanks in advance


dev

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2011-10-19 : 12:56:12
There is not a built-in function that I am aware of. But, you might be able to use of some of the date fuctions to determine the time zone offset and then display the time zone based on the offset. Here are some of the date functions you migh be able to use:
- SYSDATETIME & SYSUTCDATE
- GETDATE & GETUTCDATE

Or possibly, you might be able to use the TZoffset:
- SELECT DATEPART(TZoffset, SYSDATETIMEOFFSET())
Go to Top of Page
   

- Advertisement -