Skip to content

Commit

Permalink
Add Rfc time class and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
trickl committed Oct 6, 2019
1 parent 6b5870d commit 3cd4ebc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.trickl</groupId>
<artifactId>model-oanda</artifactId>
<version>0.1.7-SNAPSHOT</version>
<version>0.1.8-SNAPSHOT</version>
<packaging>jar</packaging>
<developers>
<developer>
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/trickl/text/oanda/Rfc3339.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.trickl.text.oanda;

import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

public class Rfc3339 {

public static final String WITH_NANO_PRECISION = "yyyy-MM-dd'T'HH:mm:ss.nnnnnnnnnX";
public static final String WITH_MILLISECOND_PRECISION = "yyyy-MM-dd'T'HH:mm:ss.nnnX";
public static final String WITH_SECOND_PRECISION = "yyyy-MM-dd'T'HH:mm:ssX";
public static final DateTimeFormatter YMDHMSN_FORMATTER =
DateTimeFormatter.ofPattern(WITH_NANO_PRECISION).withZone(ZoneId.of("UTC"));
public static final DateTimeFormatter YMDHMS_FORMATTER =
DateTimeFormatter.ofPattern(WITH_SECOND_PRECISION).withZone(ZoneId.of("UTC"));
public static final Instant YEAR_OF_2264 = Instant.ofEpochMilli(9223368436000L);
public static final DateTimeFormatter YMDHMSM_FORMATTER =
DateTimeFormatter.ofPattern(WITH_MILLISECOND_PRECISION).withZone(ZoneId.of("UTC"));
public static final Instant YEAR_OF_1970 = Instant.ofEpochMilli(1);

private Rfc3339() {}
}

0 comments on commit 3cd4ebc

Please sign in to comment.