Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
timezone puzzle
jsherriff
I need to return special date value from a sql query that Birt will recognize and treat as a null date - for my purposes I'm using the Unix epoch date (01-01-1970). All is well except that the date value Birt sees is off by my client timezone. I've found that by setting -Duser.timezone=UTC when starting the app, or when starting eclipse to test my report, all is well and the date returned by the db is exactly 01-01-1970 00:00:00. But, when I try to do the same thing by calling setTimeZone() on my run and render engine tasks, it doesn't work and the time isn't effected. Anyone have a thought as to why setTimeZone doesn't have the same effect that user.timezone does?
Find more posts tagged with
Comments
jsherriff
I further suspect that this specifically a problem for me in the scripting environment - filters, maps, etc. How can I effect the timezone used in the scripting environment?
jsherriff
Hmm, well I figured out how to set the tz for the scripting env, just as simple as putting
java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("UTC"));
in my initialize. But that causes some things to work and some not. The only thing that works for everything is setting user.timezone...yuck.
jsherriff
found the temporary fix - should have been using com.ibm.icu.util.TimeZone, not java.util.TimeZone...still, this is risky and would be nice if <engine>.setTimeZone worked for the scripting side also.