Write a new end date/time in a complex date time field

I think I must be doing something basically wrong here. I have a calendar, and want to use a field that has the duration to set the end date/time for the event.

I thought I just need to extract the END date/time from a complex date/time field, add a duration (hours) and then write the new end date/time.

Using these instructions: How to Extract the Start and End Dates from a Date Field - Knack Knowledge Base I can extract dates and times etc, and add times to a date/time field etc,

HOWEVER;

  1. For me, sometimes the complex date/time field has the end date just as a time (ie not as “dd/mm/yyyy hh:mm to dd/mm/yyyy hh:mm” ), so I cant constantly extract the end date/time (see table below).
    That in itself is not the issue, because in this case don’t care about the end date/time, (I have already calculated what that should be and just want to write it back)

  1. How do we update a complex date/time field with a new end date? or even update the whole field, ie dd/mm/yyyy hh:mm to dd/mm/yyyy hh:mm).

I have tried correctly formatting a text field (like this: as “dd/mm/yyyy hh:mm to dd/mm/yyyy hh:mm”) and setting a complex date time field to that, it just deletes whatever is in the date time field.

Am I missing something simple here? Any help greatly appreciated!

Hello Calvin,

Check the solution on another ticket

and url os the page where it’s solved.
https://roberts.knack.com/farmers#check-datestart-and-end/

Thanks,
Sunny Singla

1 Like

Thank you so much @Sunny_Singla ,

That is an ingenious way of fixing the missing end-date/time field in some of the complex date/times.
I will definitely use that! In fact I have for another part of this project.

Any chance you have a solution to second part of my question?

I don’t think I saw where you have updated a complex date/time with start and end dates with new end date/time. Even with a correctly formatted text field, I cannot seem to write that back into a complex date/time field, it just blanks out the field.

Is this correct format? “dd/mm/yyyy hh:mm to dd/mm/yyyy hh:mm” (assuming the resulting complex date/time is formatted dd/mm/yyyy hh:mm ?

Should we be able to set this, or is there another way?

This is how my fields are set up currently;




Hello Calvin,

Yes, you can do that by hiding start date field … like on below URL you can click on end date and it open a edit form and you can just update end date.

https://roberts.knack.com/farmers#check-datestart-and-end/

Regards,
Sunny Singla

1 Like

Hi Sunny,

Yes I understand the ability to hide the time parts and the start date part, and also I see where you set an end time field equal to the start if the actual complex date/time does not have an end time - brilliant. I also see how you are editing just the end date using a field.

However I actually need to use a formula to update the end time in the complex date/time field. I can achieve that with a simple date/time field, but it does not seem to work with a complex date/time field, and that is what I need.

What I have done is have a field that has the duration in hours, and that uses a formula to set a date/time field correctly with the end date (just adding the hours to the start date to get the end date), but then I cannot update my complex date/time field for the event so it can go into a calendar.

Thats the part I still don’t get. :(.