FavoritosMamatha HL (FPSS) perguntou em #Apex27 de mar. de 2015, 06:12String to date conversion?I have a string date '3/26/15' in MM/dd/yy, i want to convert to Date object. But using Date.parse(StringDate) gives me Invalid Date error even with Date.valueOf(StringDate) throws same error.Please help ASAP.Thank you in advanceSachin1 respostaClassificarClassificar por dataClassificar por mais útilClassificar por dataManoj Kumar Jena (GE Healthcare)27 de mar. de 2015, 06:19Hi Sachin,Please check below code ,It will work .String str='3/26/15';String strr=str.replace('/','-')+' 00:00:00';Date dt=Date.valueOf(strr);Adicionar um comentárioEscrever uma resposta...NegritoItálicoSublinhadoTachadoLista com marcadoresLista numeradaAdicionar linkBloco de códigosInserir imagemAnexar arquivosURL do linkCancelarSalvar0/9000Responder
Manoj Kumar Jena (GE Healthcare)27 de mar. de 2015, 06:19Hi Sachin,Please check below code ,It will work .String str='3/26/15';String strr=str.replace('/','-')+' 00:00:00';Date dt=Date.valueOf(strr);