Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: "Does anybody really know what time it is?"

Re: "Does anybody really know what time it is?"

From: Tim Bunce <Tim.Bunce_at_pobox.com>
Date: Fri, 01 Mar 2002 02:08:27 -0800
Message-ID: <F001.0041C75B.20020301020827@fatcity.com>


On Thu, Feb 28, 2002 at 07:28:22PM -0800, Jonathan Gennick wrote:
> What is a GMT epoch second? This curious mind wants to know.
>
> I can get UTC time by:
>
> alter session set time_zone='00:00';
> select current_timestamp from dual;
>
> But this doesn't get Steve the epoch seconds that he wants.

I think you can do that with something like this (untested):

 select (current_timestamp - TO_DATE('01-01-1970','DD-MM-YYYY')) * 86400 from dual

Tim.

> Oddly enough, with all this new time zone functionality, I
> don't see any way to easily translate a TIMESTAMP WITH
> TIMEZONE value from one time zone to another. For example,
> if I have 2-Feb-2002 10:30:00.00 PM -05:00, how would I go
> about converting that to Pacific Time (-07:00)? It seems
> like there ought to be a function to do it for me (NEW_TIME
> won't work here), but the solution doesn't appear that easy.
>
> Best regards,
>
> Jonathan Gennick
> mailto:jonathan_at_gennick.com * 906.387.1698
> http://Gennick.com * http://MichiganWaterfalls.com * http://ValleySpur.com
>
> Thursday, February 28, 2002, 5:56:01 PM, you wrote:
> OS> I want to get the UTC (Coordinated Universal Time) from the database without
> OS> having to escape to the O/S or write a stored proc. I want to get this time
> OS> in GMT epoch seconds without needing to know what timezone the server is in.
> OS> Can't find any Oracle supplied package for this and I'm appalled.
>
> OS> My current medulla oblongata init.ora setting is clues = 0.
>
> OS> Suggestions?
>
>
> OS> Steve Orr
> OS> Bozeman, MT
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Jonathan Gennick
> INET: jonathan_at_gennick.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Tim Bunce
  INET: Tim.Bunce_at_pobox.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Mar 01 2002 - 04:08:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US