System.Globalization.CCGregorianEraHandler.CheckDateTime C# (CSharp) Method

CheckDateTime() public method

The method checks whether a given T:System.DateTime is covered by any era.
/// The exception is thrown if the argument isn't inside the time /// span of any era. ///
public CheckDateTime ( System time ) : void
time System A /// giving the date and time. ///
return void
	public void CheckDateTime(System.DateTime time) {
		int date = CCFixed.FromDateTime(time);

		if (!ValidDate(date))
			throw new System.ArgumentOutOfRangeException("time",
				"Time value was out of era range.");
	}
		

Usage Example

Example #1
0
 /// <summary>
 /// A protected member checking a
 /// <see cref="T:System.DateTime"/> value.
 /// </summary>
 /// <param name="time">The
 /// <see cref="T:System.DateTime"/>
 /// to check.
 /// </param>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 /// The exception is thrown if the
 /// <see cref="T:System.DateTime"/> parameter is outside all
 /// supported eras.
 /// </exception>
 internal void M_CheckDateTime(DateTime time)
 {
     M_EraHandler.CheckDateTime(time);
 }