Version

DayOfYearIndexFromMonthAndDay Method

Static method to get the day of year index for a given month and day.
Syntax
'Declaration
 
Public Shared Function DayOfYearIndexFromMonthAndDay( _
   ByVal month As Integer, _
   ByVal day As Integer _
) As Integer
public static int DayOfYearIndexFromMonthAndDay( 
   int month,
   int day
)

Parameters

month
Month number
day
Day number

Return Value

Day of the year
Example
The following code example calls UltraCalendarLook's static DayOfYearIndexFromMonthAndDay to find the day of year index of today's date.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule

	Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

		' Use the date associated with today and find its DayOfYear index.
		Dim todaysDate As DateTime = DateTime.Today
		Dim dayOfYearIndex As Integer = UltraCalendarLook.DayOfYearIndexFromMonthAndDay(todaysDate.Month, todaysDate.Day)

		Debug.WriteLine("The day of year index for today (" + todaysDate.ToShortDateString() + ") is: " + dayOfYearIndex.ToString())

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;

		private void button6_Click(object sender, System.EventArgs e)
		{

			// Use todays date and find its DayOfYear index.
			DateTime todaysDate	= DateTime.Today;
			int		 dayOfYearIndex	= UltraCalendarLook.DayOfYearIndexFromMonthAndDay(todaysDate.Month, todaysDate.Day);

			Debug.WriteLine("The day of year index for today (" + todaysDate.ToShortDateString() + ") is: " + dayOfYearIndex.ToString());

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also