
net.vectorpublish.desktop.vp.api.PlainDateFormat Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2016, Peter Rader. All rights reserved.
* ___ ___ __ ______ __ __ __ __
* | | |.-----..----.| |_ .-----..----.| __ \.--.--.| |--.| ||__|.-----.| |--.
* | | || -__|| __|| _|| _ || _|| __/| | || _ || || ||__ --|| |
* \_____/ |_____||____||____||_____||__| |___| |_____||_____||__||__||_____||__|__|
*
* http://www.gnu.org/licenses/gpl-3.0.html
*/
package net.vectorpublish.desktop.vp.api;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class PlainDateFormat extends SimpleDateFormat {
public static final TimeZone NO_TIMEZONE = new TimeZone() {
@Override
public boolean useDaylightTime() {
return false;
}
@Override
public void setRawOffset(int offsetMillis) {
}
@Override
public boolean inDaylightTime(Date date) {
return false;
}
@Override
public int getRawOffset() {
return 0;
}
@Override
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds) {
return 0;
}
};
public PlainDateFormat(String format) {
super(format);
GregorianCalendar newCalendar = new GregorianCalendar();
newCalendar.setTimeZone(NO_TIMEZONE);
setCalendar(newCalendar);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy