package de.sjanusch.date;

import javax.inject.Inject;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;

public class DateFormatter {

  private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

  @Inject
  public DateFormatter() {
  }

  public String formatDate(final String date) {
    return format.format(getCalendar(date).getTime());
  }

  private Calendar getCalendar(final String time) {
    final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
    cal.setTimeInMillis(Long.parseLong(time));
    return cal;
  }
}

@@ -35,58 +35,48 @@
 java
-x.inject.Inject;%0Aimport java.text.SimpleDateFormat
+.time.LocalDate;%0Aimport java.time.ZoneId
 ;%0Aim
@@ -128,16 +128,45 @@
 eZone;%0A%0A
+import javax.inject.Inject;%0A%0A
 public c
@@ -191,87 +191,8 @@
  %7B%0A%0A
-  private final SimpleDateFormat format = new SimpleDateFormat(%22yyyy-MM-dd%22);%0A%0A
   @I
@@ -273,20 +273,21 @@
 ing 
-date
+input
 ) %7B%0A    
 retu
@@ -286,56 +286,180 @@
     
-return format.format(getCalendar(date).getTime()
+final Calendar calendar = getCalendar(input);%0A    LocalDate date = calendar.getTime().toInstant().atZone(ZoneId.of(%22Europe/Paris%22)).toLocalDate();%0A    return date.toString(
 );%0A 
@@ -510,24 +510,25 @@
 ing time) %7B%0A
+%0A
     final Ca

format date