|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
get the month (number) and year value from a dateHi,
How do I extract just the month part of a date. Say for example I wanted to get the value of 6 (as in sixth month) from todays date. Regards "Aussie Rules" <AussieRules@nospam.nospam> schrieb: \\\> How do I extract just the month part of a date. Say for example I wanted > to get the value of 6 (as in sixth month) from todays date. Dim Month As Integer = Now.Month /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Hi Aussie,
Thank you for posting. If you have a variable of type DateTime, you could use the Month property to get the month part of the date. For example, you could get the month part of today by the following statement: dim month as Integer month = DateTime.Today.Month // or month = DateTime.Now.Month If you have any questions, please don't hesitate to let me know. Sincerely, Linda Liu Microsoft Online Community Support ==================================================== When responding to posts,please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ==================================================== Linda,
I don't think it is right to give converted C# code while there is better VB code. Have a look what Herfried has showed, Just my opinion. Cor Show quoteHide quote "Linda Liu [MSFT]" <v-l***@online.microsoft.com> schreef in bericht news:7qjWHUNlGHA.2260@TK2MSFTNGXA01.phx.gbl... > Hi Aussie, > > Thank you for posting. > > If you have a variable of type DateTime, you could use the Month property > to get the month part of the date. > > For example, you could get the month part of today by the following > statement: > dim month as Integer > month = DateTime.Today.Month > // or > month = DateTime.Now.Month > > If you have any questions, please don't hesitate to let me know. > > > Sincerely, > Linda Liu > Microsoft Online Community Support > > ==================================================== > When responding to posts,please "Reply to Group" via > your newsreader so that others may learn and benefit > from your issue. > ==================================================== >
Password Protect
DataBinding with Unbound Columns and calling EndCurrentEdit ListBox Problem XML WebSvc Proxy Code Syntax Questions Limit ComboBox entry to ipaddress format firing a dts package's execution How To Show Partial Classes as a Hierarchy in Solution Explorer? HOW Change Password Passing a parameter Collection Using .NET user controls into VB6 |
|||||||||||||||||||||||