I am having a real issue trying to record the time in a field in a form. Preferably as a hidden field
I have added the date and time component
I have tried every format in the table I can think of date datetime timestamp time and also text
I have given the field on the form a dymanic value of the Var1.datetime and also tried to format it to just the time (which shows in the field correctly)
I have tried addingas a text field and converting
I have tried to change the field to a datepicker and also timepicker using the checkbox
Everything I try just adds the date and not the time to the database 2020-04-06 or 2020-04-06 00:00:00
Hello,
What is your database field type and what value do you want to store there (can you provide an example)?
Also what do you want to store - the exact time the record is inserted in the db?
Then you need to use a datetime database field type.
Instead of getting the time on the frontend, use the NOW value on the serverside and format it in the format you need.
NOW will appear in the insert record when you open the data picker.
You should have no issue using the App Connect DateTime to do this. I do it and it works great. Make sure your data field is set to datetime. The reason I do it with the App Connect DateTime feature is we have offices in two time zones and our server is located in a third. Using the App Connect Date Time uses the users date and time where as the NOW value gets the date and time from the server which is useless to us. I also use the exact same formatting that you use (without the seconds).
I should have no issue doing this with app connect date time. I’ve tried everything I can think of to get it to work without success I think I will have to go with the server side solution. I can get it to store the date part but not the time. Even when it shows both on the form field.
I was banging my head against a wall trying to do this, @Teodor your suggestion of using NOW on server side worked perfectly for me, thanks for posting!
Hi Teodor
I have tried to implement this as you suggested. I have an issue, when I try to update the record(change other fields in the table) Keeping the first date time recorded. the record overwrites and I am left with just the date and a time of 00:00:100:
date time 1 - this was initially inserted using serverside now method (recorded in this format yyyy-MM-dd HH:mm:ss)
date time 2 - this was left blank
I then needed to update the record
date time 1 (to keep its original time stamp value)
date time 2 add the current time stamp
when I tried to update date time 2 the record for date time 1 records the date but the time is reset to 00:00:00
for example date time 1 - 2020-04-07 16:15:33 becomes 2020-04-07 00:00:00
You said that you want to keep the date1 the same on update.
Then just don’t add it to the update record step! It will keep its value as it was on insert.