You need to sign in to do that
Don't have an account?
aottaru
Date Format function
Hello everyone,
I have been using a the following date format function to for format my date in the following format 'October 19, 2015'
The function has been working well but today we jsut found out that if the date selected is 2015-31-12, It is being formated as 'December 30, 2016' instead of 'December 30, 2015'
Does anyone knows what is causing this?
This is how I am calling the function dateTimeScheduled.format('MMMM d, YYYY');
I have been using a the following date format function to for format my date in the following format 'October 19, 2015'
The function has been working well but today we jsut found out that if the date selected is 2015-31-12, It is being formated as 'December 30, 2016' instead of 'December 30, 2015'
Does anyone knows what is causing this?
This is how I am calling the function dateTimeScheduled.format('MMMM d, YYYY');
I just put year notation in small instead of caps and it worked I don't know what logic that SFDC has implemented but usually day (d) and year (yyyy) are used in small letter only for date format.
Please let me know if it helped.
Regards,
Shashi
All Answers
Probably you built a custom function to format a date.Please share your custom code.I will try to help you.
Regards,
Shashi
private String formatDate(Date dateIn){
DateTime dateTimeScheduled = DateTime.newInstance(dateIn,Time.newInstance(0,0,0,0));
return dateTimeScheduled.format('MMMM d, YYYY');
}
Please let me know if this helps.
I just put year notation in small instead of caps and it worked I don't know what logic that SFDC has implemented but usually day (d) and year (yyyy) are used in small letter only for date format.
Please let me know if it helped.
Regards,
Shashi