Question

DateTime column

Hi,

I have an object that ha DateTime column in which I store TimeSpan rather than DateTime. For example I will store duration of a meeting (1 hour an 30 minutes). when I show this column in a section grid I get 12:30 AM because I my culture is set to Canada. I would like to show it as 01:30. Do you have any recommendations how t achieve it?

Like

1 comments

Hello Kirill,

You want to store value with "TimeSpan" data type in column that has "DateTime" type. This can lead to errors during saving or processing data, so it is not recommended to do that. An alternative way to achieve it is to store info about duration in three separate fields: start datetime, end datetime and duration which is calculated by subtracting end time and start time.

Also, another way is to create lookup with values of duration in step e.g. 15 minutes. After that you need to add a new field with lookup data type to the page of the object which this detail represents and bind this field to the created lookup.

Best regards,
Alex

Log in or register to comment