Days between dates: Difference between revisions

no edit summary
No edit summary
Line 1,492:
Enter date 2: 2019-10-02
There are 18171 days between these dates.</pre>
 
=={{header|M2000 Interpreter}}==
Version 12 has date type, so we can handle easy dates.
 
<syntaxhighlight lang="m2000 interpreter">
module Days_between_dates{
date a="2019-01-01", b="2019-09-30"
long z=b-a
// Use the system default to display dates (DD/MM/YYYY)
Print "Days from "+a+" to "+b+" = "+z
// using locale 1033 to display dates (MM/DD/YYYY)
Print "Days from "+date$(a, 1033)+" to "+date$(b, 1033)+" = "+z
}
Days_between_dates
</syntaxhighlight>
{{out}}
<pre>
Days from 1/1/2019 to 30/9/2019 = 272
Days from 1/1/2019 to 9/30/2019 = 272
</pre>
 
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
404

edits