juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yidon...@apache.org
Subject incubator-juneau git commit: using GMT Timezone instead of System Default, to calculate raw offset. for RFC2822_DTZ, no need to calculate raw offset.
Date Wed, 13 Sep 2017 04:21:29 GMT
Repository: incubator-juneau
Updated Branches:
  refs/heads/master 1409d75e0 -> 4f03a61e5


using GMT Timezone instead of System Default, to calculate raw offset.
for RFC2822_DTZ, no need to calculate raw offset.


Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/4f03a61e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/4f03a61e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/4f03a61e

Branch: refs/heads/master
Commit: 4f03a61e5ed811651ec740fdfdfcfaa6f48a5672
Parents: 1409d75
Author: Raphi D Lee <yidonguk@apache.org>
Authored: Wed Sep 13 13:21:49 2017 +0900
Committer: Raphi D Lee <yidonguk@apache.org>
Committed: Wed Sep 13 13:21:49 2017 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/juneau/utils/CalendarUtils.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4f03a61e/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/CalendarUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/CalendarUtils.java
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/CalendarUtils.java
index 6b72fdf..38a503c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/CalendarUtils.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/utils/CalendarUtils.java
@@ -589,14 +589,14 @@ public class CalendarUtils {
 			case SHORT_T:
 			case MEDIUM_DT:
 			case SHORT_DT:
-				d = getFormat(format, locale, TimeZone.getDefault()).parse(in);
+				d = getFormat(format, locale, GMT).parse(in);
 				d.setTime(d.getTime() - timeZone.getRawOffset());
 				break;
 
 			// This is always in GMT.
 			case RFC2822_DTZ:
-				d = getFormat(format, locale, TimeZone.getDefault()).parse(in);
-				d.setTime(d.getTime() + TimeZone.getDefault().getRawOffset());
+				DateFormat f  = getFormat(format, locale, GMT);
+				d = f.parse(in);
 				break;
 
 			// These specify timezones in the strings, so we don't use the specified timezone.


Mime
View raw message