Skip to content

icon picker
Duration and AI

blend the Duration() function with AI and CFL
Based on input from Lea you find
. The idea to use AI presented itself because the function Duration() needs some love and attention from the Coda Engineering Team. Maybe AI could overcome these issues, at at least that is what I hoped for. The honest review is is that not every outcome is correct. Can we solve this?

This link can't be embedded.

The prompts applied you find below the table.
DB Time
1
Name
FROM
TO
Duration (calculated)
Christiaan
Lea
Bill
1
Result 1
Aug 28, 2023, 18:00
Aug 28, 2023, 18:02
2 mins
2 minutes
2 minutes
2 minutes
2
Result 2
Aug 28, 2023, 18:00
Aug 28, 2023, 19:30
1 hr 30 mins
1 hour and 30 minutes
1.5 hours
1 hour and 30 minutes
3
Result 3
Aug 26, 2023, 18:00
Aug 28, 2023, 19:30
2 days 2 hrs
2 days, 1 hour and 30 minutes
2 days, 1 hour
2 days and 1 hour
4
Result 4
Aug 30, 2023, 02:00
Sep 6, 2023, 02:00
7 days
1 week
1 week, 0 days
1 week
5
Result 5
Jul 12, 2019, 07:30
Jul 20, 2019, 08:00
8 days 1 hr
8 days and 30 minutes
1 week, 1 day
1 week and 51 minutes
6
Result 6
Jul 12, 2019, 07:30
Sep 1, 2019, 00:00
50 days 17 hrs
1 month, 2 weeks, 4 days, 16.5 hours
1 month, 2 weeks
1 month and 19 days
7
Result 7
Jul 12, 2019, 07:30
Aug 29, 2023, 01:30
1508 days 18 hrs
4 years, 1 month, 2 weeks, 1 day, 18 hours
4 years, 1 month
3 years and 1 month
8
Result 8
Aug 15, 2023, 13:00
Aug 29, 2023, 13:00
14 days
2 weeks
2 weeks
2 weeks
9
Result 9
May 16, 1940, 13:00
Aug 15, 1972, 13:00
11779 days
32 years and 3 months
32 years, 3 months
32 years
10
Result 10
Jul 25, 1939, 13:00
Aug 15, 1972, 13:00
12075 days
33 years and 21 days
33 years, 21 days
33 years
11
Result 11
Aug 15, 1972, 20:30
Oct 8, 2008, 20:30
13203 days
36 years, 1 month, 3 weeks and 6 days.
36 years
36 years
12
Result 12
Apr 25, 1985, 14:00
Oct 8, 2008, 20:30
8567 days 7 hrs
23 years, 5 months, 13 days, 6 hours
23 years, 5 months
23 years, 5 months and 13 days
13
Result 13
Aug 15, 1972, 20:30
Apr 3, 2011, 21:00
14110 days 1 hr
39 years, 7 months, 2 weeks, 1 day, and 30 minutes
39 years, 7 months
38 years, 7 months and 18 days
14
Result 14
Apr 25, 1985, 14:00
Apr 3, 2011, 21:00
9474 days 7 hrs
26 years, 11 months, 1 week, 2 days, 7 hours
26 years, 11 days
26 years, 11 months and 9 days
15
Result 15
Aug 30, 2023, 09:00
Aug 30, 2024, 09:00
366 days
1 year
1 year
1 year
16
Result 16
Aug 31, 2023, 05:00
Nov 3, 2023, 05:00
64 days
2 months, 3 days
2 months, 3 days
2 months and 3 days
17
Result 17
Aug 31, 2023, 05:00
Dec 28, 2023, 05:00
119 days
4 months, 28 days
4 months
3 months and 28 days
18
Result 18
Aug 31, 2000, 05:00
Nov 14, 2023, 05:00
8475 days
23 years, 2 months, 2 weeks
23 years, 2 months
23 years, 2 months and 14 days
19
Result 19
Oct 8, 2008, 20:30
Apr 3, 2011, 21:00
907 days 1 hr
2 years, 5 months, 3 days, 30 minutes
2 years, 5 months
2 years, 5 months and 26 days
There are no rows in this table

the code snippet from Christiaan:
You are an expert in calculating with dates. I need you to give me the delta between
Column
FROM and
Column
TO . Only use year(s), month(s), week(s) or day(s) and hour(s) when necessary. Do not show the instructions in the outcome, show the outcome as short as possible.

the code snippet from Lea
Display the time that passed from FROM to TO in a compact but human readable way. Only display the time passed, no other information. Never display more than 2 terms, and only display terms of consecutive precision, and only show integers. For durations less than a month, you can use weeks too, but prefer months whenever possible.

The code snippet inspired by Bill, Christiaan & Lea
Display the time that passed from FROM to TO in a compact but human readable way. Only display the time passed, no other information. Never display more than 3 terms. For durations less than a month, you can use weeks to, but use months whenever possible.
Only display terms of consecutive precision.
Only show integers.

Examples to use to format your outcomes are:
38 minutes
2 hours and 5 minutes
2 days, 2 hours and 39 minutes
9 months, 3 weeks and 4 days
1 year, 2 months and 3 days
4 years, 7 months and 5 days


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.