Skip to content

Commit

Permalink
Fix timestamp tz parsing
Browse files Browse the repository at this point in the history
Patch by brandonwilliams; reviewed by bereng for CASSANDRA-17467
  • Loading branch information
driftx committed Mar 23, 2022
1 parent 592cee3 commit 4f5feac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
@@ -1,4 +1,5 @@
4.0.4
* Fix timestamp tz parsing (CASSANDRA-17467)
* Suppress CVE-2021-44521 from driver (CASSANDRA-17459)
* Upgrade jackson to 2.13.2 (CASSANDRA-17460)
* Make sstableloader honour native port option (CASSANDRA-17210)
Expand Down
Expand Up @@ -53,9 +53,10 @@ private static List<DateTimeFormatter> generateFormatters()
final String[] offsetFormats = new String[]
{
" z",
"X",
" zzzz",
"XXX"
" X",
"X",
"XXX",
};

for (String dateTimeFormat: dateTimeFormats)
Expand Down
Expand Up @@ -127,7 +127,11 @@ public void testGeneralTimeZoneFormats()
final long cstOffset = 6 * ONE_HOUR;
validateStringTimestamp("1970-01-01 00:00:00 Central Standard Time", cstOffset);
validateStringTimestamp("1970-01-01 00:00:00 CST", cstOffset);
validateStringTimestamp("1970-01-01 00:00:00 -0600", cstOffset);
validateStringTimestamp("1970-01-01 00:00:00-0600", cstOffset);
validateStringTimestamp("1970-01-01T00:00:00 GMT-06:00", cstOffset);
validateStringTimestamp("1970-01-01T00:00:00 -0600", cstOffset);
validateStringTimestamp("1970-01-01T00:00:00-0600", cstOffset);
}

@Test
Expand Down

0 comments on commit 4f5feac

Please sign in to comment.