1string iDate = "05/05/2005";
2DateTime oDate = Convert.ToDateTime(iDate);
3MessageBox.Show(oDate.Day + " " + oDate.Month + " " + oDate.Year );
4
1import java.text.SimpleDateFormat;
2import java.util.Date;
3public class StringToDateExample1 {
4public static void main(String[] args)throws Exception {
5 String sDate1="31/12/1998";
6 Date date1=new SimpleDateFormat("dd/MM/yyyy").parse(sDate1);
7 System.out.println(sDate1+"\t"+date1);
8}
9}
1String dtStart = "2010-10-15T09:27:37Z";
2SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
3try {
4 Date date = format.parse(dtStart);
5 System.out.println(date);
6} catch (ParseException e) {
7 e.printStackTrace();
8}
9