cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [1/2] cassandra git commit: fix default timestamp format offsets
Date Fri, 17 Jul 2015 17:47:14 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 13f2c1339 -> 87f197593


fix default timestamp format offsets


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/437bb9de
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/437bb9de
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/437bb9de

Branch: refs/heads/trunk
Commit: 437bb9de77f54aa5a4a6a634ab3d2c753a17b3fc
Parents: b10a51a
Author: T Jake Luciani <jake@apache.org>
Authored: Fri Jul 17 13:46:23 2015 -0400
Committer: T Jake Luciani <jake@apache.org>
Committed: Fri Jul 17 13:46:23 2015 -0400

----------------------------------------------------------------------
 .../org/apache/cassandra/serializers/TimestampSerializer.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/437bb9de/src/java/org/apache/cassandra/serializers/TimestampSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/serializers/TimestampSerializer.java b/src/java/org/apache/cassandra/serializers/TimestampSerializer.java
index a5884a6..ab81fcc 100644
--- a/src/java/org/apache/cassandra/serializers/TimestampSerializer.java
+++ b/src/java/org/apache/cassandra/serializers/TimestampSerializer.java
@@ -29,6 +29,9 @@ import org.apache.commons.lang3.time.DateUtils;
 
 public class TimestampSerializer implements TypeSerializer<Date>
 {
+
+    //NOTE: This list is used below and if you change the order
+    //      you need to update the default format and json formats in the code below.
     private static final String[] dateStringPatterns = new String[] {
             "yyyy-MM-dd HH:mm",
             "yyyy-MM-dd HH:mm:ss",
@@ -82,7 +85,7 @@ public class TimestampSerializer implements TypeSerializer<Date>
             "yyyy-MM-ddXXX"
     };
 
-    private static final String DEFAULT_FORMAT = dateStringPatterns[3];
+    private static final String DEFAULT_FORMAT = dateStringPatterns[6];
     private static final Pattern timestampPattern = Pattern.compile("^-?\\d+$");
 
     private static final ThreadLocal<SimpleDateFormat> FORMATTER = new ThreadLocal<SimpleDateFormat>()
@@ -93,7 +96,7 @@ public class TimestampSerializer implements TypeSerializer<Date>
         }
     };
 
-    public static final SimpleDateFormat TO_JSON_FORMAT = new SimpleDateFormat(dateStringPatterns[8]);
+    public static final SimpleDateFormat TO_JSON_FORMAT = new SimpleDateFormat(dateStringPatterns[15]);
 
     public static final TimestampSerializer instance = new TimestampSerializer();
 


Mime
View raw message