mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 22:45:51 +01:00
(refs #461)Correct atom feed datetime format
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
package view
|
package view
|
||||||
import java.util.Date
|
import java.util.{Date, TimeZone}
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import twirl.api.Html
|
import twirl.api.Html
|
||||||
import util.StringUtil
|
import util.StringUtil
|
||||||
@@ -18,7 +18,11 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
|||||||
/**
|
/**
|
||||||
* Format java.util.Date to "yyyy-MM-dd'T'hh:mm:ss'Z'".
|
* 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".
|
* Format java.util.Date to "yyyy-MM-dd".
|
||||||
|
|||||||
Reference in New Issue
Block a user