Set the Year of this dateTime to year, leaving all other all other parts
the same.
Namespace: MomentSharpAssembly: MomentSharp (in MomentSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static DateTime SetYear(
this DateTime dateTime,
int year
)
<ExtensionAttribute>
Public Shared Function SetYear (
dateTime As DateTime,
year As Integer
) As DateTime
public:
[ExtensionAttribute]
static DateTime SetYear(
DateTime dateTime,
int year
)
[<ExtensionAttribute>]
static member SetYear :
dateTime : DateTime *
year : int -> DateTime
Parameters
- dateTime
- Type: SystemDateTime
this DateTime - year
- Type: SystemInt32
new year
Return Value
Type:
DateTimeDateTime
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