You need to sign in to do that
Don't have an account?
Terminusbot
Date Format Bug? Giving wrong day of the month
I am getting the current date using system.now and then trying to format my date into this format 'MM/dd/yyyy'.
When I log the current date is shows today (2016-08-11) which of course is correct. But, when I format the date is reflects the date as yesrterday (08/10/2016).
I am spinning my wheels. Has anyone run into this? Here is what I am doing.
When I log the current date is shows today (2016-08-11) which of course is correct. But, when I format the date is reflects the date as yesrterday (08/10/2016).
I am spinning my wheels. Has anyone run into this? Here is what I am doing.
DateTime now = system.now().date(); String day = now.format('dd'); String nowFormat = now.format('MM/dd/yyyy','EST'); System.debug('Right now Date: ' + now); System.debug('Day of the Month: ' + day); System.debug('Full Date: ' + nowFormat);
All Answers