EraYear() public method

This function returns the year of the era and sets the era in an output parameter.
/// The exception is thrown if the fixed day number is outside of the /// time spans of all eras. ///
public EraYear ( int &era, int date ) : int
era int An output parameter returning the /// era number. ///
date int An integer giving the fixed day /// number. ///
return int
コード例 #1
0
ファイル: KoreanCalendar.cs プロジェクト: raj581/Marvin
        /// <summary>
        /// Overridden. Gives the era of the specified date.
        /// </summary>
        /// <param name="time">The
        /// <see cref="T:System.DateTime"/> that specifies a
        /// date.
        /// </param>
        /// <returns>An integer representing the era of the calendar.
        /// </returns>
        public override int GetEra(DateTime time)
        {
            int rd = CCFixed.FromDateTime(time);
            int era;

            M_EraHandler.EraYear(out era, rd);
            return(era);
        }
コード例 #2
0
	/// <summary>
	/// Overridden. Gives the era of the specified date.
	/// </summary>
	/// <param name="time">The
	/// <see cref="T:System.DateTime"/> that specifies a
	/// date.
	/// </param>
	/// <returns>An integer representing the era of the calendar.
	/// </returns>
	/// <exception cref="T:System.ArgumentOutOfRangeException">
	/// The exception is thrown if the
	/// <see cref="T:System.DateTime"/> parameter is outside all
	/// supported eras.
	/// </exception>
	public override int GetEra(DateTime time) {
		// M_CheckDateTime not needed, because EraYear does the
		// right thing.
		int rd = CCFixed.FromDateTime(time);
		int era;
		M_EraHandler.EraYear(out era, rd);
		return era;
	}