> If months are day offsets into the year, and day-of-month is the additional 
> days to add to the offset, and this approach is applied to smaller levels 
> too, all the screwey questions can fall into place.


And that is how date math works in DateTime. It's just not what the OP did. 

2.30a on March 10 is another case in point. If you SET the day to March 11, 
it's an error: there is no 2.30 on March 12 as its the start of DST. 

This is where the OP made his mistake. He SET the year to 2013. If he'd added a 
year to his date, all would have been (possibly*) fine.   

DateTime's strength lies in its accuracy, and an important part of that is 
validation. 

If you want to add a day, add a day. It works as you'd expect. 

Cheers!
Rick Measham
📱

* Possibly not. 
Imagine we're operating a dam and in order to be well prepared we issue a new 
command every day: in one years time, spill a gigalitre. Now next Feb 28, well 
be spilling two and destroying a village of 1384 people and their 413 goats!!!
-- 
Message  protected for iSite by MailGuard: e-mail anti-virus, anti-spam and 
content filtering.http://www.mailguard.com.au

Reply via email to