Skip to content

Commit

Permalink
Merge pull request #14 from nevermore3/fix_time
Browse files Browse the repository at this point in the history
fix time
  • Loading branch information
nevermore3 authored Aug 5, 2022
2 parents 1186b9a + 262e89b commit f1cfa86
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ protected void onInit(Map<String, String> properties, LoggingService loggingServ
}
}
dcs = new NebulaDbConnectionState(properties, new NebulaQueryStore(properties.get("queryDir")));

} catch (UnknownHostException e) {
throw new DbException(e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public class NebulaID {
public static String POST_ID_PREFIX = "s-";
public static String TAG_ID_PREFIX = "t-";
public static String TAGCLASS_ID_PREFIX = "g-";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class NebulaConverter extends Converter {
public static long convertDateTimesToEpoch(String date) throws ParseException {
final SimpleDateFormat sdf = new SimpleDateFormat(DATETIME_FORMAT);
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
return sdf.parse(date).toInstant().toEpochMilli();
return sdf.parse(date.substring(0, date.length() - 3)).toInstant().toEpochMilli();
}

public static long convertDateToEpoch(String date) throws ParseException {
Expand Down
2 changes: 1 addition & 1 deletion nebula/src/test/java/nebula/NebulaInteractiveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected Map<String, String> getProperties() {

@Test
public void testConvertTime() throws ParseException {
System.out.println(NebulaConverter.convertDateTimesToEpoch("2010-02-14T15:32:10.447"));
System.out.println(NebulaConverter.convertDateTimesToEpoch("2012-01-01T11:16:57.465000"));
}

@Test
Expand Down

0 comments on commit f1cfa86

Please sign in to comment.