diff --git a/src/main/scala/view/helpers.scala b/src/main/scala/view/helpers.scala index e83606a..6d75acf 100644 --- a/src/main/scala/view/helpers.scala +++ b/src/main/scala/view/helpers.scala @@ -1,5 +1,5 @@ package view -import java.util.Date +import java.util.{Date, TimeZone} import java.text.SimpleDateFormat import twirl.api.Html import util.StringUtil @@ -18,7 +18,11 @@ /** * Format java.util.Date to "yyyy-MM-dd'T'hh:mm:ss'Z'". */ - def datetimeRFC3339(date: Date): String = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'").format(date).replaceAll("(\\d\\d)(\\d\\d)$","$1:$2") + def datetimeRFC3339(date: Date): String = { + val sf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") + sf.setTimeZone(TimeZone.getTimeZone("UTC")) + sf.format(date) + } /** * Format java.util.Date to "yyyy-MM-dd".