Ajouter aux favorisMamatha HL (FPSS) a posé une question dans #Apex27 mars 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 réponseTriTrier par dateTrier par ordre d’utilitéTrier par dateManoj Kumar Jena (GE Healthcare)27 mars 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);Ajouter un commentaireRédiger une réponse...GrasItaliqueSoulignerBarréListe à pucesListe numérotéeAjouter un lienBloc de codeInsérer une imageJoindre des fichiersURL du lienAnnulerEnregistrer0/9000Répondre
Manoj Kumar Jena (GE Healthcare)27 mars 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);