# Working with time

**URL:** <https://community.noloco.io/t/working-with-time/358>\
**Category:** Ask for Help\
**Created:** [March 7, 2024, 10:41am UTC](https://community.noloco.io/t/working-with-time/358 "2024-03-07T10:41:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjp](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@rjp](https://community.noloco.io/u/rjp)\
**Post date:** [March 7, 2024, 10:41am UTC](https://community.noloco.io/t/working-with-time/358/1 "2024-03-07T10:41:07Z")

</div>

Looking for some direction. im trying to make a reservation form and would like a user to pick a date and time then pick a duration then using the time/date and the duration create a end date so i can store in db then push to calendar view.

04/17/2024 03:00pm + 90min = 04/17/2024 04:30pm?

---

<div class="post-metadata">

**Author:** ![rjp](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@rjp](https://community.noloco.io/u/rjp)\
**Post date:** [March 8, 2024, 11:55pm UTC](https://community.noloco.io/t/working-with-time/358/2 "2024-03-08T23:55:21Z")

</div>

BUMP… Looking for some direction on this hurdle. If anybody know how to address i would be extremely gratfull.

---

<div class="post-metadata">

**Author:** ![darragh](https://dub1.discourse-cdn.com/flex005/user_avatar/community.noloco.io/darragh/32/12_2.png) [@darragh](https://community.noloco.io/u/darragh)\
**Post date:** [March 11, 2024, 7:55am UTC](https://community.noloco.io/t/working-with-time/358/3 "2024-03-11T07:55:33Z")

</div>

Hey @rjp this can be done using a formula field

In this example, I’m using a formula field `Created At + Duration` to add the `Duration` field to the Date Time in `created at`

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/noloco/original/1X/f0b543fb71ebf76675d7161517d99605eb945846.png)

The formula look like this:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/noloco/original/1X/ca11cefec82424fa84027464ba9e51bbc60a9141.png)

```auto
TODATE( {created at} + TIME(0, 0, {Duration} ) )

```

There’s 3 parts to this.  
Firstly, all Noloco formulas work the same way they do in Excel, so typically you can search for similar solutions in excel.

To add time to a date time in excel, you simply add the time in minutes.

Do `12/02/2024 + 90` would be `12/02/2024 01:30`

So we can do the same, but we first need to convert the duration (which is stored in seconds) to minutes, or a time field for even more convenience.

`TIME(0, 0, {Duration} )`

This passes the `Duration` field into the seconds argument of the `TIME` function.

`{created at} + TIME(0, 0, {Duration} )`

This then adds that _time_ to the `created at` Date Time.

Finally, you need to convert that date value back to a Noloco Date  
[This is mentioned in our guides on using Dates in Formulas](https://guides.noloco.io/data/collections/formulas#supported-operations:~:text=date%20%2D%202-,TODATE,TODATE(date),-DATE)

```auto
TODATE( {created at} + TIME(0, 0, {Duration} ) )

```

You can replace `created at` and `Duration` with your own fields

---

<div class="post-metadata">

**Author:** ![rjp](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@rjp](https://community.noloco.io/u/rjp)\
**Post date:** [March 13, 2024, 10:57am UTC](https://community.noloco.io/t/working-with-time/358/4 "2024-03-13T10:57:01Z")

</div>

Thank you so much. Ill give it a shot.

---

<div class="post-metadata">

**Author:** ![rjp](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@rjp](https://community.noloco.io/u/rjp)\
**Post date:** [March 30, 2024, 4:53pm UTC](https://community.noloco.io/t/working-with-time/358/5 "2024-03-30T16:53:22Z")

</div>

Not quite their but close? I cant get the formula field to be date time as in your example.

 ![Screenshot 2024-03-30 at 12.51.32 PM](https://europe1.discourse-cdn.com/flex005/uploads/noloco/original/1X/2c3c17cbe58e989761581700b4e63871494adeff.png)  
 ![Screenshot 2024-03-30 at 12.51.19 PM](https://europe1.discourse-cdn.com/flex005/uploads/noloco/original/1X/66e82be03682ea808671e2dcf1f78d7a7b0c04b0.png)

---

<div class="post-metadata">

**Author:** ![darragh](https://dub1.discourse-cdn.com/flex005/user_avatar/community.noloco.io/darragh/32/12_2.png) [@darragh](https://community.noloco.io/u/darragh)\
**Post date:** [March 30, 2024, 5:00pm UTC](https://community.noloco.io/t/working-with-time/358/6 "2024-03-30T17:00:25Z")

</div>

Try creating a brand new field instead of editing an existing field - I don’t think we always (correctly) re-type the field when it’s a formula.

The formula itself looks correct
