Skip to content

Commit 775de1c

Browse files
committed
технические даты выводим по MSK
для тестов, в prod и так всегда так было
1 parent eb2b821 commit 775de1c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/scala/ru/org/linux/site/DateFormats.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ object DateFormats:
2727
private val Short = DateTimeFormat.forPattern("dd.MM.yy HH:mm").withLocale(RussianLocale)
2828
private val Time = DateTimeFormat.forPattern("HH:mm").withLocale(RussianLocale)
2929
private val Date = DateTimeFormat.forPattern("dd.MM.yy").withLocale(RussianLocale)
30+
private val Moscow = DateTimeZone.forID("Europe/Moscow")
3031

3132
private val Iso8601: DateTimeFormatter = ISODateTimeFormat.dateTime
3233
private val Rfc822: DateTimeFormatter = DateTimeFormat.forPattern("EEE, d MMM yyyy HH:mm:ss Z").withLocale(Locale.US)
3334
private val DateLong: DateTimeFormatter = DateTimeFormat.longDate().withLocale(RussianLocale)
3435

3536
def formatDefault(tz: DateTimeZone, date: Date) = Default.withZone(tz).print(date.getTime)
36-
def formatIso8601(date: Date): String = Iso8601.print(date.getTime)
37-
def formatRfc822(date: Date): String = Rfc822.print(date.getTime)
37+
def formatIso8601(date: Date): String = Iso8601.withZone(Moscow).print(date.getTime)
38+
def formatRfc822(date: Date): String = Rfc822.withZone(Moscow).print(date.getTime)
3839
def formatDateLong(tz: DateTimeZone, date: Date): String = DateLong.withZone(tz).print(date.getTime)
3940
def formatDateOnly(tz: DateTimeZone, date: Date) = Date.withZone(tz).print(date.getTime)
4041
private[site] def formatTime(tz: DateTimeZone, date: Date) = Time.withZone(tz).print(date.getTime)

0 commit comments

Comments
 (0)