cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [1/5] cassandra git commit: Fix cqlsh copy methods and timestamp format issues on windows
Date Fri, 17 Jul 2015 17:03:44 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 05a5fb4f8 -> 107f141e0


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9dc8c219/pylib/cqlshlib/formatting.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/formatting.py b/pylib/cqlshlib/formatting.py
index c0c3163..ff5b118 100644
--- a/pylib/cqlshlib/formatting.py
+++ b/pylib/cqlshlib/formatting.py
@@ -18,6 +18,7 @@ import calendar
 import math
 import re
 import sys
+import platform
 import time
 from collections import defaultdict
 from . import wcwidth
@@ -91,6 +92,9 @@ DEFAULT_NANOTIME_FORMAT = '%H:%M:%S.%N'
 DEFAULT_DATE_FORMAT = '%Y-%m-%d'
 DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S%z'
 
+if platform.system() == 'Windows':
+    DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
+
 class DateTimeFormat():
     def __init__(self, timestamp_format=DEFAULT_TIMESTAMP_FORMAT, date_format=DEFAULT_DATE_FORMAT,
nanotime_format=DEFAULT_NANOTIME_FORMAT):
         self.timestamp_format=timestamp_format

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9dc8c219/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 b575e73..a5884a6 100644
--- a/src/java/org/apache/cassandra/serializers/TimestampSerializer.java
+++ b/src/java/org/apache/cassandra/serializers/TimestampSerializer.java
@@ -32,29 +32,51 @@ public class TimestampSerializer implements TypeSerializer<Date>
     private static final String[] dateStringPatterns = new String[] {
             "yyyy-MM-dd HH:mm",
             "yyyy-MM-dd HH:mm:ss",
+            "yyyy-MM-dd HH:mm z",
+            "yyyy-MM-dd HH:mm zz",
+            "yyyy-MM-dd HH:mm zzz",
             "yyyy-MM-dd HH:mmX",
             "yyyy-MM-dd HH:mmXX",  // DEFAULT_FORMAT
             "yyyy-MM-dd HH:mmXXX",
+            "yyyy-MM-dd HH:mm:ss",
+            "yyyy-MM-dd HH:mm:ss z",
+            "yyyy-MM-dd HH:mm:ss zz",
+            "yyyy-MM-dd HH:mm:ss zzz",
             "yyyy-MM-dd HH:mm:ssX",
             "yyyy-MM-dd HH:mm:ssXX",
             "yyyy-MM-dd HH:mm:ssXXX",
-            "yyyy-MM-dd HH:mm:ss.SSS",  // TO_JSON_FORMAT
+            "yyyy-MM-dd HH:mm:ss.SSS",   // TO_JSON_FORMAT
+            "yyyy-MM-dd HH:mm:ss.SSS z",
+            "yyyy-MM-dd HH:mm:ss.SSS zz",
+            "yyyy-MM-dd HH:mm:ss.SSS zzz",
             "yyyy-MM-dd HH:mm:ss.SSSX",
             "yyyy-MM-dd HH:mm:ss.SSSXX",
             "yyyy-MM-dd HH:mm:ss.SSSXXX",
             "yyyy-MM-dd'T'HH:mm",
+            "yyyy-MM-dd'T'HH:mm z",
+            "yyyy-MM-dd'T'HH:mm zz",
+            "yyyy-MM-dd'T'HH:mm zzz",
             "yyyy-MM-dd'T'HH:mmX",
             "yyyy-MM-dd'T'HH:mmXX",
             "yyyy-MM-dd'T'HH:mmXXX",
             "yyyy-MM-dd'T'HH:mm:ss",
+            "yyyy-MM-dd'T'HH:mm:ss z",
+            "yyyy-MM-dd'T'HH:mm:ss zz",
+            "yyyy-MM-dd'T'HH:mm:ss zzz",
             "yyyy-MM-dd'T'HH:mm:ssX",
             "yyyy-MM-dd'T'HH:mm:ssXX",
             "yyyy-MM-dd'T'HH:mm:ssXXX",
             "yyyy-MM-dd'T'HH:mm:ss.SSS",
+            "yyyy-MM-dd'T'HH:mm:ss.SSS z",
+            "yyyy-MM-dd'T'HH:mm:ss.SSS zz",
+            "yyyy-MM-dd'T'HH:mm:ss.SSS zzz",
             "yyyy-MM-dd'T'HH:mm:ss.SSSX",
             "yyyy-MM-dd'T'HH:mm:ss.SSSXX",
             "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
             "yyyy-MM-dd",
+            "yyyy-MM-dd z",
+            "yyyy-MM-dd zz",
+            "yyyy-MM-dd zzz",
             "yyyy-MM-ddX",
             "yyyy-MM-ddXX",
             "yyyy-MM-ddXXX"


Mime
View raw message