Here is my code:
Date myDate = startTime.Date(); //e.g. myDate =2016-03-01
Date weekStartDate = myDate.toStartofWeek(); //weekStartDate results 2016-28-02
When myDate
equals 2016-03-01
the value of weekStartDate
is 2016-28-02
. According to my understanding it should be 2016-29-02
.
Is this a bug or am I missing something?