Extract month num and week num from date

cfisher440

Well-known member
Joined
Oct 11, 2005
Messages
73
Programming Experience
1-3
If I have a date value in the format 11/03/2005
How would I extract the month value (11) & the week value (1) from the
date?
 
Last edited by a moderator:
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] d [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DateTime[/SIZE]
[SIZE=2]d.Parse("11/3/2005")[/SIZE]
[SIZE=2]System.Console.WriteLine("M: {0} D: {1} Y: {2}", d.Month, d.Day, d.Year)[/SIZE]
 
Back
Top