I'm using this code :
Time t = Time.newInstance(12, 0, 0, 0); DateTime dt = DateTime.newInstance(Date.parse('22/02/2016'), t); system.debug(LoggingLevel.WARN, Integer.valueof(dt.Format('w')));
9 but if I check in Salesforce calendar, the February 22nd corresponds to week
Can someone explain me why ?
It seems there is a bug with this method. I try the following code :
DateTime dt = DateTime.newInstance(2016, 1, 8); String tz = 'Europe/Paris'; system.debug(LoggingLevel.WARN, Integer.valueof(dt.Format('w', tz)));
2 but in the calendar for this time zone (Salesforce calendar for example) the week number is
I don't know what I can do with this !