Groups | Blog | Home
all groups > asp.net > march 2007 >

asp.net : Split the date


ajash.pv NO[at]SPAM gmail.com
3/12/2007 9:27:16 PM
i want to split date as date ,month, year, from the input like
value of textbox1.text="03/06/2007"

i want it like

03(month)

06(day)

2007(year)

separately, and want to store each value in different integer
variables

plz send coding....
Adlai Maschiach
3/12/2007 11:31:08 PM
Hi

try

DateTime dt = DateTime.ParseExact("03/06/2007","MM/dd/yyyy",null);
dt.Month
dt.Year
dt.Day

Adlai
---------------------------------
If my answer helped you please press "Yes" bellow

Adlai Maschiach
http://blogs.microsoft.co.il/blogs/adlaim/


[quoted text, click to view]
AddThis Social Bookmark Button