List of usage examples for com.google.common.base Strings padEnd
public static String padEnd(String string, int minLength, char padChar)
From source file:eu.trentorise.opendata.jackan.CkanClient.java
/** * Formats a timestamp according to {@link #CKAN_TIMESTAMP_PATTERN}, with * precision up to microseconds.//from w ww .j a va 2s . co m * * @see #parseTimestamp(java.lang.String) for the inverse process. * @since 0.4.1 */ @Nullable public static String formatTimestamp(Timestamp timestamp) { if (timestamp == null) { throw new IllegalArgumentException("Found null timestamp!"); } Timestamp ret = Timestamp.valueOf(timestamp.toString()); ret.setNanos((timestamp.getNanos() / 1000) * 1000); return Strings.padEnd(ret.toString().replace(" ", "T"), "1970-01-01T01:00:00.000001".length(), '0'); }