Days between dates: Difference between revisions
Content deleted Content added
Added C# |
|||
Line 212:
There are 274 days between 2015-12-31 and 2016-09-30
</pre>
=={{header|Kotlin}}==
<lang scala>import java.time.LocalDate
import java.time.temporal.ChronoUnit
fun main() {
val fromDate = LocalDate.parse("2019-01-01")
val toDate = LocalDate.parse("2019-10-19")
val diff = ChronoUnit.DAYS.between(fromDate, toDate)
println("Number of days between $fromDate and $toDate: $diff")
}</lang>
{{out}}
<pre>Number of days between 2019-01-01 and 2019-10-19: 291</pre>
=={{header|Lua}}==
|