Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date field 4

Status
Not open for further replies.

wekoweko

Programmer
Feb 1, 2004
18
0
0
PH
hi everyone, once again am here to ask for your help, am having a discrepancy in my data, am in manila but my oracle and web servers are in the usa, and whenever i try to insert data into a date field (which i had set to default sysdate), the date of course that goes into the field is about 12 hrs wrong, anyone out there have any ideas how to resolve this? will i have to pass the date from the client side back to the server side? is there any other way? thanks all
 
I think you have a time zone issue. Are you sure you need to insert your local date? Sysdate is obviously processed on server and is the same for all applications regardless on client location.

Regards, Dima
 
yeah unfortunately i do, you see it has like a view your transaction history on the client side, and obviously when a user views his history, there are a lot of off by one day errors
 
Is it possible for you to rework your setup to use a TIMESTAMP WITH LOCAL TIME ZONE instead of just a DATE?

Alternatively, could you rework your view to add/subtract the correct number of hours?

Elbert, CO
0914 MST
 
Wekoweko,

Kumusta Ka?

I built the following Oracle function for you (named "Manila_Time"), which should solve your need:
Code:
create or replace function manila_time (time_in in date) return date is
begin
	return time_in + ((1/24)*15);
      /* above, 16=Pacific Time Zone, 15=Mountain Time Zone, 14=Central Time Zone,
		13=Eastern Time Zone */
end;
/

SQL> select to_char(manila_time(sysdate),'yyyy-mm-dd hh24:mi:ss') manila_time from dual;

MANILA_TIME
-------------------
2004-02-05 01:10:01

Sana ito ang maganda para sa iyo. Ing at.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 17:11 (04Feb04) GMT, 10:11 (04Feb04) Mountain Time)
 
Please have a look at:

select new_time(sysdate, 'EST', 'HDT') from dual

It will convert an eastern standard time to Hawaii-Alaska time.

Regards,
Dan

 
hey you guys thanks a lot for the suggestions, and santamufasa kamusta ka din? wer u from dude? thanks for the tip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top