public String formatDate(PersonIdent ident) {switch (format) {case RAW:int offset = ident.getTimeZoneOffset();String sign = offset < 0 ? "-" : "+"; int offset2;if (offset < 0)offset2 = -offset;elseoffset2 = offset;int hours = offset2 / 60;int minutes = offset2 % 60;return String.format("%d %s%02d%02d", ident.getWhen().getTime() / 1000, sign, hours, minutes);case RELATIVE:return RelativeDateFormatter.format(ident.getWhen());case LOCALELOCAL:case LOCAL:dateTimeInstance.setTimeZone(SystemReader.getInstance().getTimeZone());return dateTimeInstance.format(ident.getWhen());case LOCALE:TimeZone tz = ident.getTimeZone();if (tz == null)tz = SystemReader.getInstance().getTimeZone();dateTimeInstance.setTimeZone(tz);dateTimeInstance2.setTimeZone(tz);return dateTimeInstance.format(ident.getWhen()) + " " + dateTimeInstance2.format(ident.getWhen());default:tz = ident.getTimeZone();if (tz == null)tz = SystemReader.getInstance().getTimeZone();dateTimeInstance.setTimeZone(ident.getTimeZone());return dateTimeInstance.format(ident.getWhen());}}

public virtual string FormatDate(PersonIdent ident){TimeZoneInfo tz;switch (format){case GitDateFormatter.Format.RAW:{int offset = ident.GetTimeZoneOffset();string sign = offset < 0 ? "-" : "+";int offset2;if (offset < 0){offset2 = -offset;}else{offset2 = offset;}int hours = offset2 / 60;int minutes = offset2 % 60;return string.Format("%d %s%02d%02d", ident.GetWhen().GetTime() / 1000, sign, hours, minutes);}case GitDateFormatter.Format.RELATIVE:{return RelativeDateFormatter.Format(ident.GetWhen());}case GitDateFormatter.Format.LOCALELOCAL:case GitDateFormatter.Format.LOCAL:{dateTimeInstance.SetTimeZone(SystemReader.GetInstance().GetTimeZone());return dateTimeInstance.Format(ident.GetWhen());}case GitDateFormatter.Format.LOCALE:{tz = ident.GetTimeZone();if (tz == null){tz = SystemReader.GetInstance().GetTimeZone();}dateTimeInstance.SetTimeZone(tz);dateTimeInstance2.SetTimeZone(tz);return dateTimeInstance.Format(ident.GetWhen()) + " " + dateTimeInstance2.Format(ident.GetWhen());}default:{tz = ident.GetTimeZone();if (tz == null){tz = SystemReader.GetInstance().GetTimeZone();}dateTimeInstance.SetTimeZone(ident.GetTimeZone());return dateTimeInstance.Format(ident.GetWhen());break;}}}
