Can't understand how to compare DateTime with opCmp

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 1 14:21:09 PST 2015


On Sunday, February 01, 2015 19:22:40 Suliman via Digitalmars-d-learn wrote:
> "+ n.days" solved my problem.

Roll is specifically for cases where you want one of the fields to increase
or decrease without affecting the others (e.g. if you had a spin control in
your GUI with a DateTime backing it and didn't want any units other than the
currently altered unit to change when its value wrapped around). In most
cases, you're simply going to want to add a Duration to it - which
dt + days(n) or dt + n.days will do.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list