Skip to main content
Mamatha HL (FPSS) 님이 #Apex에 질문했습니다
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 advance

Sachin
답변 1개
  1. 2015년 3월 27일 오전 6:19
    Hi 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);
0/9000