04-04-2022
10:58 PM
- last edited on
01-12-2023
09:17 AM
by
JackLacava
Hello,
I have a requirement to allow users to enter a date in "dd/MM/yyyy HH:mm:ss" format.
I have below settings for DCode1:
When I see the Register table (backend), I can see the the date is stored with time:
The register (frontend) also shows the time:
but it doesn't allow to enter date with time and give following error: "Value could not be converted".
So my question is: Can we enter a date along with time in a Register? An alternative would be to have a seperate text field for "HH:mm:ss" and convert date and time fields in rule for calculations but it would be good if we can enter both in the same field.
Thanks,
Sid
Solved! Go to Solution.
04-05-2022 11:09 AM
Oh, I see it now, if it is not the current time then the above won't work. You'll have to use a new column. I'm still not able to understand why time is needed.
04-05-2022 06:25 AM
If you just enter the date and save, backed table stores current time or the default time 12:00:00 AM?
04-05-2022 06:30 AM
Hi Bharti,
The time to be entered is not the current time. It has to be chosen by the user. The date would be a history date.
Sid
04-05-2022 06:55 AM
Please check internally what is the datatype for your column.
Select * from Information_schema.columns where table_name = 'XFW_PLP_Register'.
I see only Date type as datatype for some of the columns like HireDate, BirthDate so not sure if these columns are built in to capture the time details as well. I see a Datetime_precision column, pls check if this can be set to capture date and time in the desired format.
04-05-2022 11:07 AM
Not really sure why you need to capture the timing. Is it for auditing? If so, why not use the Audit logs?
Even though the datatype is DateTime, I don't think the front end shows a time. It just shows a calendar. If you are really truly looking for it, then I would say use the event handler and update the date field to capture the current time and add to the existing value the user chose.
04-05-2022 11:09 AM
Oh, I see it now, if it is not the current time then the above won't work. You'll have to use a new column. I'm still not able to understand why time is needed.
04-05-2022 05:28 PM
Hi Celvin,
Its not for auditing. The register I am building is for contracts that changes by minutes. I think best to use another text field for time.
Sid