<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Converting Time Zones in Oracle</title>
	<atom:link href="http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/</link>
	<description>because I don't believe in life before coffee...</description>
	<lastBuildDate>Wed, 23 Nov 2011 03:01:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sunil B</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-376716</link>
		<dc:creator>Sunil B</dc:creator>
		<pubDate>Mon, 22 Nov 2010 09:41:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-376716</guid>
		<description>Hi All,

I am a newbie in this domain. And would like to know how I can convert GMT into other TimeZones?

I have a timestamp in GMT and want to convert it to EST and MST, how I can use oracle to convert this?

Will Appreciate your response.

Thanks,
Sunil</description>
		<content:encoded><![CDATA[<p>Hi All,</p>
<p>I am a newbie in this domain. And would like to know how I can convert GMT into other TimeZones?</p>
<p>I have a timestamp in GMT and want to convert it to EST and MST, how I can use oracle to convert this?</p>
<p>Will Appreciate your response.</p>
<p>Thanks,<br />
Sunil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jithin</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-375551</link>
		<dc:creator>Jithin</dc:creator>
		<pubDate>Thu, 04 Mar 2010 08:07:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-375551</guid>
		<description>Thanks for the information.But I have a query.

How we can convert GMT to GMT+4.</description>
		<content:encoded><![CDATA[<p>Thanks for the information.But I have a query.</p>
<p>How we can convert GMT to GMT+4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parag</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-375389</link>
		<dc:creator>Parag</dc:creator>
		<pubDate>Mon, 23 Nov 2009 07:00:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-375389</guid>
		<description>Found answer to my question/issue quickly (wanted to see some columns in different timezones). Thanks</description>
		<content:encoded><![CDATA[<p>Found answer to my question/issue quickly (wanted to see some columns in different timezones). Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rowman</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-373680</link>
		<dc:creator>rowman</dc:creator>
		<pubDate>Wed, 10 Jun 2009 13:50:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-373680</guid>
		<description>we have used this two function:

(each schema has its own time_zone stored in sys_values table)

create or replace
function LOC_DATETIME(pDATE in date) return date is
  vTimeZone varchar2(50);
  vDbZone varchar2(50);
begin
  select TIME_ZONE into vTimeZone from sys_values;
  vDbZone := &#039;Europe/BRUSSELS&#039;;
  return
    to_date(to_char(from_tz(TO_TIMESTAMP(to_char(pDATE,&#039;mm-dd-yyyy hh24:mi:ss&#039;),
      &#039;mm-dd-yyyy hh24:mi:ss&#039;),vDbZone) at time zone vTimeZone,&#039;mm-dd-yyyy hh24:mi:ss&#039;), &#039;mm-dd-yyyy hh24:mi:ss&#039;);
end;
/
create or replace
function DB_DATETIME(pDATE in date) return date is
  vTimeZone varchar2(50);
  vDbZone varchar2(50);
begin
  select TIME_ZONE into vTimeZone from sys_values;
  vDbZone := &#039;Europe/BRUSSELS&#039;;
  return
    to_date(to_char(from_tz(TO_TIMESTAMP(to_char(pDATE,&#039;mm-dd-yyyy hh24:mi:ss&#039;),
      &#039;mm-dd-yyyy hh24:mi:ss&#039;),vTimeZone) at time zone vDbZone,&#039;mm-dd-yyyy hh24:mi:ss&#039;), &#039;mm-dd-yyyy hh24:mi:ss&#039;);
end;
/

it works</description>
		<content:encoded><![CDATA[<p>we have used this two function:</p>
<p>(each schema has its own time_zone stored in sys_values table)</p>
<p>create or replace<br />
function LOC_DATETIME(pDATE in date) return date is<br />
  vTimeZone varchar2(50);<br />
  vDbZone varchar2(50);<br />
begin<br />
  select TIME_ZONE into vTimeZone from sys_values;<br />
  vDbZone := &#8216;Europe/BRUSSELS&#8217;;<br />
  return<br />
    to_date(to_char(from_tz(TO_TIMESTAMP(to_char(pDATE,&#8217;mm-dd-yyyy hh24:mi:ss&#8217;),<br />
      &#8216;mm-dd-yyyy hh24:mi:ss&#8217;),vDbZone) at time zone vTimeZone,&#8217;mm-dd-yyyy hh24:mi:ss&#8217;), &#8216;mm-dd-yyyy hh24:mi:ss&#8217;);<br />
end;<br />
/<br />
create or replace<br />
function DB_DATETIME(pDATE in date) return date is<br />
  vTimeZone varchar2(50);<br />
  vDbZone varchar2(50);<br />
begin<br />
  select TIME_ZONE into vTimeZone from sys_values;<br />
  vDbZone := &#8216;Europe/BRUSSELS&#8217;;<br />
  return<br />
    to_date(to_char(from_tz(TO_TIMESTAMP(to_char(pDATE,&#8217;mm-dd-yyyy hh24:mi:ss&#8217;),<br />
      &#8216;mm-dd-yyyy hh24:mi:ss&#8217;),vTimeZone) at time zone vDbZone,&#8217;mm-dd-yyyy hh24:mi:ss&#8217;), &#8216;mm-dd-yyyy hh24:mi:ss&#8217;);<br />
end;<br />
/</p>
<p>it works</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick McShea</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-367789</link>
		<dc:creator>Patrick McShea</dc:creator>
		<pubDate>Fri, 07 Mar 2008 17:38:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-367789</guid>
		<description>I&#039;ve got a problem with java that extends to dbtimezone. If the dbtimezone defaults to a given timezone (ostensibly when created if not explicitly stated it&#039;s SUPPOSED to get the OS timezone and I can&#039;t see that ANYWHERE in the registry of my windows machine where it&#039;s set to GMT -7:00 (we&#039;re in GMT -6:00)) when it&#039;s created, and its default in this case is off by an hour compared to the server it&#039;s on, the java I&#039;m calling converts the milliseconds of a given date according to the offset between the dbtimezone and the server setting)...  When I change the dbtimezone to match the server and restart the instance it STILL acts as if it&#039;s in the old time zone.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got a problem with java that extends to dbtimezone. If the dbtimezone defaults to a given timezone (ostensibly when created if not explicitly stated it&#8217;s SUPPOSED to get the OS timezone and I can&#8217;t see that ANYWHERE in the registry of my windows machine where it&#8217;s set to GMT -7:00 (we&#8217;re in GMT -6:00)) when it&#8217;s created, and its default in this case is off by an hour compared to the server it&#8217;s on, the java I&#8217;m calling converts the milliseconds of a given date according to the offset between the dbtimezone and the server setting)&#8230;  When I change the dbtimezone to match the server and restart the instance it STILL acts as if it&#8217;s in the old time zone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suhail Khaki</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-50797</link>
		<dc:creator>Suhail Khaki</dc:creator>
		<pubDate>Tue, 30 Jan 2007 12:33:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-50797</guid>
		<description>very useful and well presented information. Thank you</description>
		<content:encoded><![CDATA[<p>very useful and well presented information. Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prasad Narmeta</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-23622</link>
		<dc:creator>Prasad Narmeta</dc:creator>
		<pubDate>Wed, 03 Jan 2007 05:17:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-23622</guid>
		<description>Vasant,
There is another way you can check..
You need to alter your session.. Here is an example to convert from CET to EST..

alter session set nls_date_format = &#039;DD.MM.YYYY HH24:MI:SS&#039;;
alter session set NLS_TIMESTAMP_FORMAT = &#039;DD.MM.YYYY HH24:MI:SSXFF&#039;;
alter session set time_zone = &#039;US/Eastern&#039;;


select id,time1, to_date(to_char((from_tz(to_timestamp(time1, &#039;dd-mm-yyyy hh24:mi:ss&#039;) ,&#039;Europe/BRUSSELS&#039;) 
at time zone &#039;US/Eastern&#039;),&#039;mm-dd-yyyy hh24:mi:ss&#039;),&#039;mm-dd-yyyy hh24:mi:ss&#039;) from Table1

This will also takes care of Daylight Savings.

Hope this helps.

Prasad.</description>
		<content:encoded><![CDATA[<p>Vasant,<br />
There is another way you can check..<br />
You need to alter your session.. Here is an example to convert from CET to EST..</p>
<p>alter session set nls_date_format = &#8216;DD.MM.YYYY HH24:MI:SS&#8217;;<br />
alter session set NLS_TIMESTAMP_FORMAT = &#8216;DD.MM.YYYY HH24:MI:SSXFF&#8217;;<br />
alter session set time_zone = &#8216;US/Eastern&#8217;;</p>
<p>select id,time1, to_date(to_char((from_tz(to_timestamp(time1, &#8216;dd-mm-yyyy hh24:mi:ss&#8217;) ,&#8217;Europe/BRUSSELS&#8217;)<br />
at time zone &#8216;US/Eastern&#8217;),&#8217;mm-dd-yyyy hh24:mi:ss&#8217;),&#8217;mm-dd-yyyy hh24:mi:ss&#8217;) from Table1</p>
<p>This will also takes care of Daylight Savings.</p>
<p>Hope this helps.</p>
<p>Prasad.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-4462</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 30 Aug 2006 00:35:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-4462</guid>
		<description>Jeff,

You should check the docs for your version of Oracle.  I believe this varies, but my guess is your dates will continue to be displayed in their originally inserted GMT.</description>
		<content:encoded><![CDATA[<p>Jeff,</p>
<p>You should check the docs for your version of Oracle.  I believe this varies, but my guess is your dates will continue to be displayed in their originally inserted GMT.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-4412</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Mon, 28 Aug 2006 16:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-4412</guid>
		<description>I have a database that stores date values in GMT, and currently the DBTIMEZONE is set to GMT as well, if I change the DBTIMEZONE, will dates be displayed in the GMT (stored) format, or will they be displayed in the DBTIMEZONE offset from GMT?

Thansk!
Jeff</description>
		<content:encoded><![CDATA[<p>I have a database that stores date values in GMT, and currently the DBTIMEZONE is set to GMT as well, if I change the DBTIMEZONE, will dates be displayed in the GMT (stored) format, or will they be displayed in the DBTIMEZONE offset from GMT?</p>
<p>Thansk!<br />
Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergio</title>
		<link>http://www.lifeaftercoffee.com/2005/09/22/converting-time-zones-in-oracle/comment-page-1/#comment-2305</link>
		<dc:creator>Sergio</dc:creator>
		<pubDate>Tue, 27 Jun 2006 18:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/?p=70#comment-2305</guid>
		<description>Useful article, thanks.  Note that a database restart is required in order for the alter database set TIME_ZONE= to take effect.

Sergio</description>
		<content:encoded><![CDATA[<p>Useful article, thanks.  Note that a database restart is required in order for the alter database set TIME_ZONE= to take effect.</p>
<p>Sergio</p>
]]></content:encoded>
	</item>
</channel>
</rss>

