Best way to calculate column2 minus column1?

Untitled

My Code
String time1 = “16:00:00”;
String time2 = “19:00:00”;

SimpleDateFormat format = new SimpleDateFormat(“HH:mm:ss”);
Date date1 = format.parse(time1);
Date date2 = format.parse(time2);
long difference = date2.getTime() - date1.getTime();

Hi Guys,

Could you help me where to put my code on the calculation of man hours base on start and end time. Im confuse should i use service, component/datasource listenener in implementing this.

What is the best practice.

Thank you.

Hi @Earl02,

You can define this property as read-only metaproperty right in you Entity definition, exactly as it is shown in this sample project.

Regards,
Aleksey

I see, i already set default values on entity definitions for some fields. So metaproperty with a getter. Thanks i will give it a try. :slight_smile:

@stukalov Thanks so far its working :slight_smile:Capture

1 Like