Skip to content

Commit

Permalink
Replace GMT with history server side TimeZone.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyum committed Nov 2, 2017
1 parent b04eefa commit 17bddef
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import java.lang.annotation.Annotation
import java.lang.reflect.Type
import java.nio.charset.StandardCharsets
import java.text.SimpleDateFormat
import java.util.{Calendar, Locale, SimpleTimeZone}
import java.util.{Calendar, Locale, TimeZone}
import javax.ws.rs.Produces
import javax.ws.rs.core.{MediaType, MultivaluedMap}
import javax.ws.rs.ext.{MessageBodyWriter, Provider}
Expand Down Expand Up @@ -86,8 +86,9 @@ private[v1] class JacksonMessageWriter extends MessageBodyWriter[Object]{

private[spark] object JacksonMessageWriter {
def makeISODateFormat: SimpleDateFormat = {
val iso8601 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'GMT'", Locale.US)
val cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"))
val timeZone = TimeZone.getDefault
val iso8601 = new SimpleDateFormat(s"yyyy-MM-dd'T'HH:mm:ss.SSS'${timeZone.getID}'", Locale.US)
val cal = Calendar.getInstance(timeZone)
iso8601.setCalendar(cal)
iso8601
}
Expand Down

0 comments on commit 17bddef

Please sign in to comment.