Indicates whether the specified DateTime is on a weekend day.

Namespace: System.Extensions
Assembly: System.Extensions (in System.Extensions.dll) Version: 0.0.0.5 (0.0.0.5)

Syntax

C#
public static bool IsWeekend(
	this DateTime dateTime
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function IsWeekend ( 
	dateTime As DateTime
) As Boolean
Visual C++
public:
[ExtensionAttribute]
static bool IsWeekend(
	DateTime dateTime
)
F#
static member IsWeekend : 
        dateTime : DateTime -> bool 

Parameters

dateTime
Type: System..::..DateTime
The DateTime to check.

Return Value

Type: Boolean
True if the day represented is a weekend day; false otherwise.

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).

See Also