Jump to content

whether and what extend is timezone auto converion supported


171334125

Recommended Posts

  • Environment

JasperServer (6.0.1) and AWS Redshift database (the latest version) of UTC timezone. The local timezone for experiment is UTC+8.

  • Purpose

Fully support local timezone to run report, i.e., the input and output date/time are based on the local timezone.

For example, if an user queries data of the date 2015-11-05, i.e., [2015-11-05 00:00:00, 2015-11-06 00:00:00), then two conversions are desired, 1) convert the local time to UTC [2015-11-04 16:00:00, 2015-11-05 16:00:00) and then query against UTC-based database; 2) convert database resultset back to UTC+8 [2015-11-05 00:00:00, 2015-11-06 00:00:00) to be of local timezone.  

  • Report

Input: there exists two input parameters to indicate the period of data to query;

Output: there exist one output filed of java.sql.Timestamp to indicate the timestamp of this record;

  • Questions
  1. Whether is the scenario above supported or not? if yes, what is right way to achieve it? if not fully supported, then what extend can it be supported?
  2. The observation during fail and trial is: 1) if the inputs are set as the type 'java.sql.Timestamp' then the first conversion can happen automatically, but if the type is set as 'java.util.Date' then it will not happen. Is that expected? For the second conversion, it never happened, do we have to do it ourselves?

 

BTW, I already managed to know how to pass the local timezone to JasperServer (userTimezone) and how to retrieve it in JasperServer wherever needed (TimeZoneContextHolder).

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...