Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #92 from constantcontact/MOB-5721-zulu-pattern
Browse files Browse the repository at this point in the history
MOB-5721 fix date pattern for QueryDate, hh --> HH
  • Loading branch information
ggrell authored Jun 12, 2018
2 parents 6e549dd + 984227b commit b50f769
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ allprojects {

group = 'com.constantcontact'
def isRelease = Boolean.valueOf(project.hasProperty("release") ? project.property("release") as String : "false")
version = '5.2.1' + (isRelease ? "" : "-SNAPSHOT")
version = '5.2.2' + (isRelease ? "" : "-SNAPSHOT")
}

apply plugin: "net.wooga.github"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* The converter factory used for Jackson JSON conversion
*/
public class JacksonConverterFactory extends Converter.Factory {
public final static String ISO_8601_DATE_PATTERN = "yyyy-MM-dd'T'hh:mm:ss.SS'Z'";
public final static String ISO_8601_DATE_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SS'Z'";

public final static SimpleDateFormat ISO_8601_DATE_FORMAT;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.constantcontact.v2;

import org.junit.Test;

import java.time.ZonedDateTime;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;

public class QueryDateTests {

@Test
public void test24HourDateConversions() {
ZonedDateTime date = ZonedDateTime.parse("2018-06-04T09:07:30-04:00");
QueryDate qd = new QueryDate(date.toInstant().toEpochMilli());
assertThat(qd.toString().indexOf("2018-06-04T13:07:30.00Z"), not(equalTo(-1)));
}
}

0 comments on commit b50f769

Please sign in to comment.