Home » Infrastructure » Unix » change sysdate to get date other than OS date
change sysdate to get date other than OS date [message #97653] Tue, 15 October 2002 10:42 Go to next message
stan
Messages: 7
Registered: October 1999
Junior Member
Hi,
I want to change the system function SYSDATE to return
a date other than the system clock. The purpose of this is to avoid wounding the system clock and yet
sysdate would return me an arbitrary date I want and
without changing hundreds of my pl/sql programs using
sysdate.
thanks
Re: change sysdate to get date other than OS date [message #97657 is a reply to message #97653] Wed, 16 October 2002 09:33 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
There is no way that I know of doing this. As far as I know it gets OS date with no offset by design.

You can freeze sysdate - but I've yet to find a use for that.
alter system set fixed_date = '1980_01_01_00_00-00'

System altered

select sysdate from dual

SYSDATE
-----------------------
01/01/1980
1 row selected

alter system set fixed_date = none

System altered

select sysdate from dual

SYSDATE
-----------------------
10/16/2002 10:25:52 AM
1 row selected
Re: change sysdate to get date other than OS date [message #97739 is a reply to message #97657] Wed, 11 December 2002 12:52 Go to previous message
badri
Messages: 7
Registered: October 2001
Junior Member
Hi:

I want to test to make sure that the to_timestamp_tz function returns the right results...I am also changing the oracle date to something other than the OS date and so figured I would post a reply to this original question.

I do the following but the results show no change in the TZH parameter...what am I doing wrong?

alter system set fixed_date='2002-03-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-04-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-05-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-06-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-07-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-08-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-09-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-10-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;
alter system set fixed_date='2002-11-01';
select to_timestamp_tz(to_char(sysdate,'YYYY-MM-DD HH24:MI:SS')) from dual;

All of these statements show the same offset (-5:00) without accounting for daylight savings...how do I know the function works?

thanks
Previous Topic: Unix/Solaris File Size Limitation
Next Topic: How to read sqlloader log files for rejected records
Goto Forum:
  


Current Time: Tue Nov 26 05:51:34 CST 2024