You need to sign in to do that
Don't have an account?
venkateshyadav1243
Converting Date to words
Hi,
I have a requirement parsing csv file into salesforce(insert and update.)
I have a date field called in Period Start Date (MM/DD/YYYY.)
But my client is giving me Date Format like this MARCH 2014,
So can anyone please guide me how to convert date filed into This format MARCH 2014,APRIL 2013
a.PeriodStart__c=date.ValueOf(inputvalues[10]);
Thanks for your help and guidance
Regards,
Venkatesh
I have a requirement parsing csv file into salesforce(insert and update.)
I have a date field called in Period Start Date (MM/DD/YYYY.)
But my client is giving me Date Format like this MARCH 2014,
So can anyone please guide me how to convert date filed into This format MARCH 2014,APRIL 2013
a.PeriodStart__c=date.ValueOf(inputvalues[10]);
Thanks for your help and guidance
Regards,
Venkatesh
And then replace this line
with the following
I changed code when I am uploading its showing this error
System.TypeException: Invalid date: Jan-14
and check the debug log to see what the actual value is?
List <String> dateParts = inputvalues[10].split(' ');
String monthValue = dateParts[0].trim().toLowerCase();
Integer monthIndex = months.get(monthValue);
Integer year = Integer.valueOf(dataParts[1].trim());
Date myDate = Date.newInstance(year, monthIndex, 1);
in debug log
am providing like this in my csv file " jan-14 " , i tried to keep like this JANUARY 2014 in csv but i dont get any option to set date like this format