You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Yash Sharma (JIRA)" <ji...@apache.org> on 2015/06/03 20:21:38 UTC
[jira] [Commented] (LENS-495) CubeColumn startTime and endTime are
getting formatted according to local time zone of the machine on which code
is run
[ https://issues.apache.org/jira/browse/LENS-495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571443#comment-14571443 ]
Yash Sharma commented on LENS-495:
----------------------------------
[~himanshu.gahlaut] Are there any specific testcases identified or is it for all the testcases which might not be using proper formatted time ?
> 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
> Reporter: Himanshu Gahlaut
> 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)