ManipulateStartOf Method (DateTime, DateTimeParts) |
Get the start of this dateTime at part. E.g.
DateTime.Now.StartOf(DateTimeParts.Year)
return a new DateTime at the start of the current year.
Namespace: MomentSharpAssembly: MomentSharp (in MomentSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static DateTime StartOf(
this DateTime dateTime,
DateTimeParts part
)
<ExtensionAttribute>
Public Shared Function StartOf (
dateTime As DateTime,
part As DateTimeParts
) As DateTime
public:
[ExtensionAttribute]
static DateTime StartOf(
DateTime dateTime,
DateTimeParts part
)
[<ExtensionAttribute>]
static member StartOf :
dateTime : DateTime *
part : DateTimeParts -> DateTime
Parameters
- dateTime
- Type: SystemDateTime
this DateTime - part
- Type: MomentSharpDateTimeParts
DateTimeParts
Return Value
Type:
DateTimeDateTime at the start of give
partUsage 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