1
$\begingroup$

Here the simplest example of this kind of bug

In[16]:= Now > Now
During evaluation of In[16]:= Greater::nordol: Mon 11 Sep 2017 18:23:39GMT+2. and Mon 11 Sep 2017 18:23:39GMT+2. cannot be compared because they are overlapping.
Out[16]= DateObject[{2017, 9, 11, 18, 23, 39.0091}, "Instant","Gregorian", 2.] >DateObject[{2017, 9, 11, 18, 23, 39.0091},"Instant","Gregorian", 2.]

Same error if we pause for less than 1 second like

Now>(Pause[0.2];Now)

The inequality does not return an error only if we pause for more than one second. I tried on two different laptops with OS Fedora 25 and 26 respectevely, Mathematica version 11.1. On the other hand, the mathematica-online version of this inequality correctly return False.

EDIT 1

A workaround I've found

NumericalOrder[Now, Now] == 1

True
$\endgroup$
3
  • $\begingroup$ Please do not use the bugs tag until the behavior has been confirmed by other users. $\endgroup$
    – J. M.'s torpor
    Sep 11 '17 at 16:34
  • $\begingroup$ The Cloud version is running version 11.2, which will be released for the desktop soon. So it seems any untoward behavior in 11.1 has been fixed there. $\endgroup$
    – J. M.'s torpor
    Sep 11 '17 at 16:35
  • 1
    $\begingroup$ So how to sort two dateobjects (or timeobjects) that are less than one second apart in time? Given two files, I need to compare FileDate@"file1" with FileDate@"file2" or to compare it with Now; I would like a solution that works regardless of the time interval spanning between the mentioned objects. Thank You. $\endgroup$
    – Fortsaint
    Sep 12 '17 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.