Re: System Time

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: Fri, 4 Jan 2008 07:17:09 -0800 (PST)
Message-ID: <5c391bfa-7e82-435b-9059-8e8678a926c0@s19g2000prg.googlegroups.com>


On Jan 4, 7:26 am, "tamkat..._at_gmail.com" <tamkat..._at_gmail.com> wrote:
> On 4 Jan., 06:42, l..._at_tech-trans.com wrote:
>
> > Hi!
>
> > SQL> select systimestamp from dual;
>
> > SYSTIMESTAMP
> > ----------------------------------------------------------
> > 04-Jan-08 05.40.38.275785 AM +00:00
>
> >   How can I modify +00:00?  Thanks!
>
> > Ming
>
> Hi Ming,
>
> SYSTIMESTAMP, along with the ordinary timestamp, displays the DB
> server time zone (in this case +00:00 = UTC TZ), which is fixed and is
> not immediately modifyable.
>
> Provided your client is in the same timezone as the DB server, you can
> get rid of the TZ info with
>
> SQL> select localtimestamp from dual; -- we are now in +00:00
>
> LOCALTIMESTAMP
> ---------------------------------------------------------------------------
> 08-01-04 13:10:16,908000
>
> But if you are in a different timezone, say, +01:00, LOCALTIMESTAMP
> will include the timezone directly in the timestamp, so
>
> SQL> select localtimestamp from dual; -- we are in +01:00
>
> LOCALTIMESTAMP
> ---------------------------------------------------------------------------
> 08-01-04 14:10:16,908000
>          ^^
>
> And of course you can manipulate the timestamp directly to "modify"
> the TZ info (but why modify correct info ?) or just get rid of it :
>
> SQL> select to_char(systimestamp,'YYYY-MM-DD HH24:MI:SS:FF') from
> dual;
>
> TO_CHAR(SYSTIMESTAMP,'YYYY-MM
> -----------------------------
> 2008-01-04 13:10:17:846000
>
> - Kenneth Koenraadt

Maybe the current_timestamp function which "returns the current date and time in the session time zone, in a value of datatype TIMESTAMP WITH TIME ZONE" will be of interest here.

The client would need to have the NLS time zone information set. This can be done at the OS level or via an alter session command.

HTH -- Mark D Powell -- Received on Fri Jan 04 2008 - 09:17:09 CST

Original text of this message