what is the best format for an attribute that must show duration in following format HH:mm:ss ?
Hi all,
I need to create an attribute that must contain a duration. I will set up this attribute by Java API, but I need to show this attribute in the following format: HH:mm:ss. What type must I use for this attribute?
I try with Timestamp, Duration and long (as Time Spent), but I can not show in this format.
Any suggestions?
I need to create an attribute that must contain a duration. I will set up this attribute by Java API, but I need to show this attribute in the following format: HH:mm:ss. What type must I use for this attribute?
I try with Timestamp, Duration and long (as Time Spent), but I can not show in this format.
Any suggestions?
2 answers
Hello I don't realy get what you need.
But if you want to do it programmaticaly try this:
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
But if you want to do it programmaticaly try this:
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
String myDateString = "12:34:56";
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
Date date = sdf.parse(myDateString);
Comments
Here my views on how RTC handles timestamp type attributes: https://rsjazz.wordpress.com/2014/07/22/manage-scheduled-absences-using-the-plainjava-client-libraries/
You would typically use a timestamp attribute, however the way it is displayed is controlled by the Editor Presentation you use and there are only the ones available that RTC provides.
You can use a string type, in which chase you would have to format the string as you want it. Please be aware that it will just be a string and not be handled as timestamp. E.g. you would have no date picker.
You would typically use a timestamp attribute, however the way it is displayed is controlled by the Editor Presentation you use and there are only the ones available that RTC provides.
You can use a string type, in which chase you would have to format the string as you want it. Please be aware that it will just be a string and not be handled as timestamp. E.g. you would have no date picker.
Comments
showing 5 of 6
show 1 more comments