You need to sign in to do that
Don't have an account?
Manjeet
Date Format issue ????
Hi All,
DateTime myDate = DateTime.newInstance(2010,10,10);
String strDate = myDate.format('yyyy/mm/dd');
does not give expected result '2010/10/10' .Rather it give '2010/00/10' .
?
plz let me know where i am wrong or the format method has some flaw .
Hi Manjeet,
Please do the following:
This will work.
All Answers
Hi Manjeet,
Please do the following:
This will work.
Thanks a lot .it is working for me .
But Even apex is case insensitive then what was the problem with small 'mm' ?
Hi Manjeet,
You are right, that apex is case insensitive.
but the date formats are case sensitive.
In regards to the date format, the lowercase "mm" is used to indicate minutes, and the uppercase "MM" is used to indicate months, that was your issue. By default, you were setting hours, minutes and seconds to all zeros, which is what you saw with your string format.
Yes, you are absolutely right.
I miscommunicated it.