public string ToString(string format, IFormatProvider formatProvider) { if (!string.IsNullOrEmpty(format)) { format = format.Replace("K", "zzz"); format = format.Replace("zzz", Offset.Hours.ToString("+00;-00", CultureInfo.InvariantCulture) + ":" + Offset.Minutes.ToString("00;00", CultureInfo.InvariantCulture)); format = format.Replace("zz", Offset.Hours.ToString("+00;-00", CultureInfo.InvariantCulture)); format = format.Replace("z", Offset.Hours.ToString("+0;-0", CultureInfo.InvariantCulture)); } return(ClockDateTime.ToString(format, formatProvider)); }
public string ToString(string format, IFormatProvider formatProvider) { if (!string.IsNullOrEmpty(format)) { if (format.Equals("u", StringComparison.Ordinal)) { return(string.Concat( _dateTime.ToString(UtcFormatString, formatProvider), "Z")); } else if (format.Equals("r", StringComparison.OrdinalIgnoreCase)) { return(string.Concat( _dateTime.ToString(RUtcFormatString, formatProvider), " GMT")); } if (format.Equals("K", StringComparison.Ordinal)) { throw new FormatException("The 'K' format specifier cannot appear as the single character in format"); } format = OffsetToString(format); } else { return(string.Concat( ClockDateTime.ToString(formatProvider), " ", OffsetToString("K"))); } string result = ClockDateTime.ToString(format, formatProvider); if (format.Equals("o", StringComparison.OrdinalIgnoreCase) && _dateTime.Kind == DateTimeKind.Unspecified) { result += OffsetToString("zzz"); } return(result); }
public override int GetHashCode() { return((string.Format("{0} | {1}", StaffId, ClockDateTime.ToString("dd/MM/yyyy HH:mm:ss"))).GetHashCode()); }
public override string ToString() { return(string.Format("{0} - {1} - {2}", StaffId, ClockDateTime.ToString("dd/MM/yyyy HH:mm:ss"), RecordStatus)); }