Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Jonathan M Davis via Digitalmars-d-learn
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 a

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
"+ n.days" solved my problem.

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
Thanks! Could anybody say how can I use roll if I need to date to date. For example I need to plus: DateTime currentdt = cast(DateTime)(Clock.currTime()); with another DateTime var foo.

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Rene Zwanenburg via Digitalmars-d-learn
On Sunday, 1 February 2015 at 15:04:39 UTC, Suliman wrote: I need to compare to DateTime. I looked at docs and found opCmp for DateTime type. The problem is that I can't understand how to use it. http://dlang.org/phobos/std_datetime.html#DateTime opCmp(in DateTime rhs); what is rhs? I am try

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread FG via Digitalmars-d-learn
On 2015-02-01 at 16:04, Suliman wrote: opCmp(in DateTime rhs); what is rhs? RHS is probably short of "right hand side", ie. the argument on the right side of the operator in a binary operator expression. In `a < b` it would be b. I am trying to do something like this: if( DateTime.opCmp(dti

Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
I need to compare to DateTime. I looked at docs and found opCmp for DateTime type. The problem is that I can't understand how to use it. http://dlang.org/phobos/std_datetime.html#DateTime opCmp(in DateTime rhs); what is rhs? I am trying to do something like this: if( DateTime.opCmp(dtindb, ou