package net.vexelon.currencybg.srv.utils;

import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import net.vexelon.currencybg.srv.Defs;

public class DateTimeUtilsNew {

	public static void main(String[] args) {
		System.out.println(removeTimeZone("2016-12-03T20:01:10+03:00", Defs.DATETIME_FORMAT));
	}

	/**
	 * Converts String ZoneDateTime from user specific to Europe/Sofia using
	 * using Java 8 DateTime API
	 * 
	 * @param date
	 * @param dateFormatter
	 * @return
	 */
	public static String removeTimeZone(String timeFrom, String dateTimeFormatter) {
		ZonedDateTime fromIsoDate = ZonedDateTime.parse(timeFrom);
		ZoneOffset offset = ZoneOffset.of("+02:00");
		ZonedDateTime acst = fromIsoDate.withZoneSameInstant(offset);

		// System.out.println("Input: " + fromIsoDate);
		// System.out.println("Output: " +
		// acst.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));
		// System.out.println(DateTimeFormatter.ofPattern("yyyy-MM-dd
		// HH:mm:ss").format(acst));
		return DateTimeFormatter.ofPattern(dateTimeFormatter).format(acst);
	}
}

@@ -145,215 +145,39 @@
 r;%0A%0A
-import net.vexelon.currencybg.srv.Defs;%0A%0Apublic class DateTimeUtilsNew %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(removeTimeZone(%222016-12-03T20:01:10+03:00%22, Defs.DATETIME_FORMAT));%0A%09%7D
+public class DateTimeUtilsNew %7B
 %0A%0A%09/

Remove test main method from DateTimeUtilsNew