from string to date

Solutions on MaxInterview for from string to date by the best coders in the world

showing results for - "from string to date"
Paloma
22 Aug 2019
1string iDate = "05/05/2005";
2DateTime oDate = Convert.ToDateTime(iDate);
3MessageBox.Show(oDate.Day + " " + oDate.Month + "  " + oDate.Year );
4
Jadon
15 Jan 2019
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}  
Silvana
24 Mar 2020
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
similar questions
queries leading to this page
from string to date