cancel
Showing results for 
Search instead for 
Did you mean: 

Enter Date with Time in a Register

SRAI
New Contributor III

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:

SRAI_1-1649126783891.pngSRAI_0-1649126749488.png

When I see the Register table (backend), I can see the the date is stored with time:

SRAI_2-1649126965591.png

The register (frontend) also shows the time:

SRAI_4-1649127089966.png

but it doesn't allow to enter date with time and give following error: "Value could not be converted".

SRAI_5-1649127174917.png

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

 

 

 

 

 

1 ACCEPTED SOLUTION

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.

View solution in original post

6 REPLIES 6

BhartiParyani
Contributor

If you just enter the date and save, backed table stores current time or the default time 12:00:00 AM? 

Thanks,
Bharti Paryani

SRAI
New Contributor III

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

 

 

 

 

 

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. 

Thanks,
Bharti Paryani

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.

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.

SRAI
New Contributor III

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