Permalink
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (25 sloc) 649 Bytes
metadata:
title: Difference between dates
example start: 2
example end: 3
documentation: "https://docassemble.org/docs/functions.html#date_difference"
---
modules:
- docassemble.base.util
---
code: |
birthday = as_datetime('5/17/2016')
christmas = as_datetime('12/25/2016')
interval = date_difference(starting=birthday, ending=christmas)
---
question: |
The length of time between my
birthday and Christmas can be
described several ways.
subquestion: |
* ${ interval.weeks } weeks
* ${ interval.days } days
* ${ interval.hours } hours
* ${ interval.minutes } minutes
* ${ interval.seconds } seconds
mandatory: True