171334125 Posted November 9, 2015 Share Posted November 9, 2015 EnvironmentJasperServer (6.0.1) and AWS Redshift database (the latest version) of UTC timezone. The local timezone for experiment is UTC+8.PurposeFully 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. ReportInput: 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;QuestionsWhether 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?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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now