/**
 * Copyright (C) 2014 Thiago Moreira (tmoreira2020@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package br.com.thiagomoreira.replicon.util;

import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public class DateUtil {

	public static Date translateDate(
			br.com.thiagomoreira.replicon.model.Date date) {
		return translateDate(date, false);
	}

	public static Date translateDate(
			br.com.thiagomoreira.replicon.model.Date date, boolean isEndDate) {

		Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT-0"));

		calendar.set(Calendar.YEAR, date.getYear());
		calendar.set(Calendar.MONTH, date.getMonth() - 1);
		if (isEndDate) {
			calendar.set(Calendar.DAY_OF_MONTH, date.getDay() + 1);
		} else {
			calendar.set(Calendar.DAY_OF_MONTH, date.getDay());
		}
		calendar.set(Calendar.HOUR, 0);
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.SECOND, 0);
		calendar.set(Calendar.MILLISECOND, 0);

		return calendar.getTime();
	}

	public static br.com.thiagomoreira.replicon.model.Date translateDate(
			Date date) {

		Calendar calendar = Calendar.getInstance();

		calendar.set(Calendar.HOUR, 0);
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.SECOND, 0);
		calendar.set(Calendar.MILLISECOND, 0);

		calendar.setTime(date);

		br.com.thiagomoreira.replicon.model.Date result = new br.com.thiagomoreira.replicon.model.Date();

		result.setYear(calendar.get(Calendar.YEAR));
		result.setMonth(calendar.get(Calendar.MONTH) + 1);
		result.setDay(calendar.get(Calendar.DAY_OF_MONTH));

		return result;
	}

}

@@ -1474,24 +1474,79 @@
 ISECOND, 0);
+%0A%09%09calendar.setTimeZone(TimeZone.getTimeZone(%22GMT-0%22));
 %0A%0A%09%09return c
@@ -1717,33 +1717,54 @@
 ndar.set
-(Calendar.HOUR, 0
+TimeZone(TimeZone.getTimeZone(%22GMT-0%22)
 );%0A%09%09cal
@@ -1776,36 +1776,41 @@
 .set(Calendar.MI
-NUTE
+LLISECOND
 , 0);%0A%09%09calendar
@@ -1857,33 +1857,62 @@
 (Calendar.MI
-LLISECOND
+NUTE, 0);%0A%09%09calendar.set(Calendar.HOUR
 , 0);%0A%0A%09%09cal

Configure timezone to GMT-0