[ 
https://issues.apache.org/jira/browse/GRIFFIN-206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikolay Sokolov updated GRIFFIN-206:
------------------------------------
    Description: 
When job is created from UI, time zone offset is created by this piece of code:
{code:none}
let time = new Date().getTimezoneOffset() / 60;
let timezone = "GMT" + time + ":00";
{code}
Problem is, that for GMT-7 it yields positive number, resulting in calculated 
timezone to be GMT+7.

Turns out that that some formats are not parsed properly, at least UTCXX:XX 
format used by UI is not processed correctly, and GMTXX:XX (without signs):
{code:none}
scala> java.util.TimeZone.getTimeZone("GMT6")
res9: java.util.TimeZone = 
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]

scala> java.util.TimeZone.getTimeZone("GMT+6")
res10: java.util.TimeZone = 
sun.util.calendar.ZoneInfo[id="GMT+06:00",offset=21600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]

scala> java.util.TimeZone.getTimeZone("UTC+6")
res11: java.util.TimeZone = 
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]

scala> java.util.TimeZone.getTimeZone("UTC-6(CST)")
res12: java.util.TimeZone = 
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
{code}

  was:
When job is created from UI, time zone offset is created by this piece of code:
{code:none}
let time = new Date().getTimezoneOffset() / 60;
let timezone = "GMT" + time + ":00";
{code}

Problem is, that for GMT-7 it yields positive number, resulting in calculated 
timezone to be GMT+7.


> Wrong sign of time zone offset when created from UI
> ---------------------------------------------------
>
>                 Key: GRIFFIN-206
>                 URL: https://issues.apache.org/jira/browse/GRIFFIN-206
>             Project: Griffin (Incubating)
>          Issue Type: Bug
>            Reporter: Nikolay Sokolov
>            Assignee: Nikolay Sokolov
>            Priority: Major
>
> When job is created from UI, time zone offset is created by this piece of 
> code:
> {code:none}
> let time = new Date().getTimezoneOffset() / 60;
> let timezone = "GMT" + time + ":00";
> {code}
> Problem is, that for GMT-7 it yields positive number, resulting in calculated 
> timezone to be GMT+7.
> Turns out that that some formats are not parsed properly, at least UTCXX:XX 
> format used by UI is not processed correctly, and GMTXX:XX (without signs):
> {code:none}
> scala> java.util.TimeZone.getTimeZone("GMT6")
> res9: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> scala> java.util.TimeZone.getTimeZone("GMT+6")
> res10: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT+06:00",offset=21600000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> scala> java.util.TimeZone.getTimeZone("UTC+6")
> res11: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> scala> java.util.TimeZone.getTimeZone("UTC-6(CST)")
> res12: java.util.TimeZone = 
> sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to