/** * Get timezone object for the given offset. * * @param tzOffset * timezone offset as in {@link #getTimeZoneOffset()}. * @return time zone object for the given offset. * @since 4.1 */ public static TimeZone getTimeZone(int tzOffset) { StringBuilder tzId = new StringBuilder(8); tzId.append("GMT"); //$NON-NLS-1$ appendTimezone(tzId, tzOffset); return TimeZone.getTimeZone(tzId.toString()); }
/** * Construct a new identity from an OpenPGP User ID. * * @param userId * OpenPGP User ID; any UTF-8 string. * @param when * local time. * @param tzOffset * timezone offset; see {@link #getTimeZoneOffset()}. */ public PushCertificateIdent(String userId, long when, int tzOffset) { this.userId = userId; this.when = when; this.tzOffset = tzOffset; StringBuilder sb = new StringBuilder(userId).append(' ').append(when / 1000) .append(' '); PersonIdent.appendTimezone(sb, tzOffset); raw = sb.toString(); }
/** * Format for Git storage. * * @return a string in the git author format */ public String toExternalString() { final StringBuilder r = new StringBuilder(); appendSanitized(r, getName()); r.append(" <"); //$NON-NLS-1$ appendSanitized(r, getEmailAddress()); r.append("> "); //$NON-NLS-1$ r.append(when / 1000); r.append(' '); appendTimezone(r, tzOffset); return r.toString(); }
/** * @param tzOffset * timezone offset as in {@link #getTimeZoneOffset()}. * @return time zone object for the given offset. * @since 4.1 */ public static TimeZone getTimeZone(int tzOffset) { StringBuilder tzId = new StringBuilder(8); tzId.append("GMT"); //$NON-NLS-1$ appendTimezone(tzId, tzOffset); return TimeZone.getTimeZone(tzId.toString()); }
/** * Get timezone object for the given offset. * * @param tzOffset * timezone offset as in {@link #getTimeZoneOffset()}. * @return time zone object for the given offset. * @since 4.1 */ public static TimeZone getTimeZone(int tzOffset) { StringBuilder tzId = new StringBuilder(8); tzId.append("GMT"); //$NON-NLS-1$ appendTimezone(tzId, tzOffset); return TimeZone.getTimeZone(tzId.toString()); }
/** * Construct a new identity from an OpenPGP User ID. * * @param userId * OpenPGP User ID; any UTF-8 string. * @param when * local time. * @param tzOffset * timezone offset; see {@link #getTimeZoneOffset()}. */ public PushCertificateIdent(String userId, long when, int tzOffset) { this.userId = userId; this.when = when; this.tzOffset = tzOffset; StringBuilder sb = new StringBuilder(userId).append(' ').append(when / 1000) .append(' '); PersonIdent.appendTimezone(sb, tzOffset); raw = sb.toString(); }
/** * Construct a new identity from an OpenPGP User ID. * * @param userId * OpenPGP User ID; any UTF-8 string. * @param when * local time. * @param tzOffset * timezone offset; see {@link #getTimeZoneOffset()}. */ public PushCertificateIdent(String userId, long when, int tzOffset) { this.userId = userId; this.when = when; this.tzOffset = tzOffset; StringBuilder sb = new StringBuilder(userId).append(' ').append(when / 1000) .append(' '); PersonIdent.appendTimezone(sb, tzOffset); raw = sb.toString(); }
/** * Format for Git storage. * * @return a string in the git author format */ public String toExternalString() { final StringBuilder r = new StringBuilder(); appendSanitized(r, getName()); r.append(" <"); //$NON-NLS-1$ appendSanitized(r, getEmailAddress()); r.append("> "); //$NON-NLS-1$ r.append(when / 1000); r.append(' '); appendTimezone(r, tzOffset); return r.toString(); }
/** * Format for Git storage. * * @return a string in the git author format */ public String toExternalString() { final StringBuilder r = new StringBuilder(); appendSanitized(r, getName()); r.append(" <"); //$NON-NLS-1$ appendSanitized(r, getEmailAddress()); r.append("> "); //$NON-NLS-1$ r.append(when / 1000); r.append(' '); appendTimezone(r, tzOffset); return r.toString(); }