[ https://issues.apache.org/jira/browse/LENS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Puneet Gupta updated LENS-495: ------------------------------ Fix Version/s: (was: 2.6) > CubeColumn startTime and endTime are getting formatted according to local > time zone of the machine on which code is run > ----------------------------------------------------------------------------------------------------------------------- > > Key: LENS-495 > URL: https://issues.apache.org/jira/browse/LENS-495 > Project: Apache Lens > Issue Type: Bug > Components: cube > Reporter: Himanshu Gahlaut > Assignee: Yash Sharma > Labels: newbie > > Using simple date format "yyyy-MM-dd-HH-mm", startTime 01-01-2015 will get > formatted to 2015-01-01-00-00 on a server / developer machine running with > UTC time zone where as the same will be formatted to 2015-01-01-05-30 on a > server / developer machine running in IST. > A test case which is expecting 2015-01-01-00-00 as a result of formatting > will run fine in UTC time zone and will fail when the same is run on a > machine in some other time zone. Test case can be made more generic by > creating expected formatted string in local time zone but thats just adding > un-required complexity to test case. > Also changing displayed time strings based on client time zone can be a > requirement but changing the same based on the time zone of the machine > (server) on which code is run seems to be an undesired behavior. > One of the ways to fix this is to create SimpleDateFormat instance with time > zone as UTC and consistently use UTC everywhere to keep things simple: > SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH"); > sdf.setTimeZone(TimeZone.getTimeZone("UTC")); -- This message was sent by Atlassian JIRA (v6.3.4#6332)