datetime class : Month getter

Description

Gets the month portion represented by this instance.

Syntax

datetimeInstance.Month

Arguments

None

Return value

ClassDescription
intMonth portion of datetime (from 1 to 12)

Sample code

1:

datetime dt = new datetime(2016, 3, 4, 4, 13, 0);

2:

int month = dt.Month; // 3

Notes

It's a wrapper of the System.DateTime.Month property.

Links for reference

Copyright © Cooker All rights reserved.