Change timestamp parsing to include milliseconds.

This commit is contained in:
Winston Li
2015-03-09 21:29:03 +00:00
parent e6bdbe8f17
commit e7c1b29008
8 changed files with 30 additions and 30 deletions

View File

@@ -85,7 +85,7 @@ public class SnapshotGetDocResult extends Result {
email = userObject.get("email").getAsString();
} else {
name = "Anonymous";
email = "anonymous@writelatex.com";
email = "anonymous@overleaf.com";
}
}
}

View File

@@ -33,12 +33,12 @@ public class Snapshot implements Comparable<Snapshot> {
userEmail = user.getEmail();
TimeZone tz = TimeZone.getDefault();
Calendar cal = Calendar.getInstance(tz);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
sdf.setCalendar(cal);
try {
cal.setTime(sdf.parse(info.getCreatedAt()));
} catch (ParseException e) {
throw new RuntimeException(e);
} catch (ParseException e2) {
throw new RuntimeException(e2);
}
createdAt = cal.getTime();