Advertisement

03.03.2005 at 10:32AM PST, ID: 21336728
[x]
Attachment Details

timezone handling in oracle reports

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0
Tags:

to_timezone, oracle

HI,

We deal with timezone in our databases.  if it is EPT between Ist sunday of Apr to last sunday of Oct , then it is EST(current time) date +1/24 or else  est is same as as ept.

EPT EASTERN PREVAILING TIME
EST EASTERN STANDARD TIME

How can i use the function given below to be incorporated in the reports , that when the user pulls the est / ept from drop down list, it automatically gives the data for the corresponding timezone with the correct dates.


any help

Right now we have table hr_info which has time, time_ept as columns and is filled by a procedure with respective date and times and all our reports are joined to this table which is not very efficient like the the table is getting overfilled, or if something goes wrong in the table all the reports will not work.

sample report select:

select decode(:timezone, 'EPT', h.time_ept, h.time), u.unit from unit u, hr_info h
where u.date_time = h.time;


We have also have this function in our database.

function date_timezone_adjusted(input_date date, to_timezone varchar2 := 'EPT',other varchar2 := 'EST')
  return date is
  from_timezone  constant varchar2(3) := 'EST';
  date_adjusted  date;
begin
  date_adjusted := input_date;
  if upper(to_timezone) = 'EPT' then
      if input_date between date_start_dst(to_char(input_date,'RRRR'))
                        and date_end_dst(to_char(input_date,'RRRR')) then
      date_adjusted := new_time(input_date,from_timezone,'EDT');
      end if;
  elsif upper(to_timezone) = 'CST' then
    date_adjusted := new_time(input_date,from_timezone,upper(to_timezone));
  elsif upper(to_timezone) = 'CPT' then
    date_adjusted := new_time(input_date,from_timezone,'CST');
    if input_date between date_start_dst(to_char(input_date,'RRRR'))
                     and date_end_dst(to_char(input_date,'RRRR')) then
     date_adjusted := new_time(input_date,from_timezone,'CDT');
    end if;
  end if;
  if upper(other) = 'EPT' then
     if input_date between date_start_dst(to_char(input_date,'RRRR'))
                        and date_end_dst(to_char(input_date,'RRRR')) then
      date_adjusted := new_time(input_date,from_timezone,'CST');
       end if;
  end if;
    return date_adjusted;
end date_timezone_adjusted;



any help would be app
 
Expert Comment by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by SNEHA04:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by SNEHA04:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by SNEHA04:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by lookingforjava:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Accepted Solution by neo9414:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Administrative Comment by TheLearnedOne:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Administrative Comment by TheLearnedOne:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Administrative Comment by modulo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
20081119-EE-VQP-46