1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-02-28 09:21:49 -05:00

Carddav: adjust bday to timezone

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1237 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-20 17:19:01 +00:00
parent caf263e1bb
commit 1a1e7a960b

View File

@ -1765,7 +1765,10 @@ public abstract class ExchangeSession {
if (value != null && value.length() > 0) {
try {
SimpleDateFormat parser = ExchangeSession.getZuluDateFormat();
result = ExchangeSession.getVcardBdayFormat().format(parser.parse(value));
Calendar cal = Calendar.getInstance();
cal.setTime(parser.parse(value));
cal.add(Calendar.HOUR_OF_DAY, 12);
result = ExchangeSession.getVcardBdayFormat().format(cal.getTime());
} catch (ParseException e) {
LOGGER.warn("Invalid date: " + value);
}
@ -2820,6 +2823,9 @@ public abstract class ExchangeSession {
SimpleDateFormat parser;
if (value.length() == 10) {
parser = ExchangeSession.getVcardBdayFormat();
} else if (value.length() == 15) {
parser = new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.ENGLISH);
parser.setTimeZone(GMT_TIMEZONE);
} else {
parser = ExchangeSession.getExchangeZuluDateFormat();
}