Click or drag to resize

ScheduleHelperGetFiscalYear Method

Gets the fiscal year from the provided date.

Namespace:  Xcalibur.Helpers
Assembly:  Xcalibur.Helpers (in Xcalibur.Helpers.dll) Version: 1.0.1.0 (1.0.1.0)
Syntax
public static int GetFiscalYear(
	this DateTime date
)

Parameters

date
Type: SystemDateTime
The date.

Return Value

Type: Int32

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Examples
C#
 1static void Main(string[] args)
 2{
 3    // A date within the current fiscal year
 4    var currentYear = new DateTime(2017, 1, 1);
 5    Console.WriteLine(currentYear.GetFiscalYear());
 6
 7    // A date within the next fiscal year
 8    var nextYear = new DateTime(2017, 10, 1);
 9    Console.WriteLine(nextYear.GetFiscalYear());
10
11    // Hold
12    Console.Read();
13}
14
15/* Result: 
16 *
17 * 2017
18 * 2018
19 */
See Also