public static void IsUtc( DateTime arg, [InvokerParameterName] string argName) { if (arg.Kind != DateTimeKind.Utc) { throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg); } }
public static void IsUtc( DateTimeOffset arg, [NotNull, InvokerParameterName] string argName) { if (!arg.IsUtc()) { throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg); } }
public static void IsUtcAndDateOnly( DateTime arg, [InvokerParameterName] string argName) { if (arg.Kind != DateTimeKind.Utc) { throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg); } if (arg.TimeOfDay > TimeSpan.Zero) { throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg); } }
public static void IsUtcAndDateOnly( DateTimeOffset arg, [NotNull, InvokerParameterName] string argName) { if (!arg.IsUtc()) { throw DateTimeCodeExceptions.ArgumentNotUtc(argName, arg); } if (arg.TimeOfDay > TimeSpan.Zero) { throw DateTimeCodeExceptions.ArgumentWithTime(argName, arg); } }