package de.aikiit.fotocollector.main;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * @author hirsch
 * @version 2016-03-10, 23:38
 */
public class DateJacksonSerializer extends JsonSerializer<Date> {
    @Override
    public void serialize(final Date value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
        String formattedDate = value != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.GERMANY).format(value) : "none";
        gen.writeString(formattedDate);
    }
}

@@ -363,16 +363,43 @@
 .Locale;
+%0Aimport java.util.TimeZone;
 %0A%0A/**%0A *
@@ -681,24 +681,25 @@
 ption %7B%0A
+%0A
         
 String f
@@ -694,46 +694,133 @@
     
-String formattedDate = value != null ?
+if (value == null) %7B%0A            gen.writeString(%22none%22);%0A            return;%0A        %7D%0A%0A        final SimpleDateFormat sdf =
  new
@@ -879,31 +879,62 @@
 ANY)
-.format(value) : %22none%22
+;%0A        sdf.setTimeZone(TimeZone.getTimeZone(%22GMT%22))
 ;%0A  
@@ -959,21 +959,25 @@
 ing(
+sdf.
 format
-tedDate
+(value)
 );%0A 

Add timezone.