You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Kazuaki Miyauchi <mi...@gmail.com> on 2014/09/04 09:32:23 UTC

How to get short description of interval data by EL?

 Hi,

 I'm making Web-DB program using JSTL on Tomcat and Postgres.
In there, I'd like to show interval data using EL. But,
${rowSelect.interval} shows following long data.

0 years 0 mons 0 days 0 hours 13 mins 15.114 secs

interval is data of interval type of Postgres.

 How can I get normal expression such as "0:13:15" using EL?

 Regards,                                                    Kazuaki Miyauchi

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@tomcat.apache.org
For additional commands, e-mail: taglibs-user-help@tomcat.apache.org


Re: How to get short description of interval data by EL?

Posted by Kazuaki Miyauchi <mi...@gmail.com>.
2014-09-04 17:04 GMT+09:00 Stuart Thiel <st...@gmail.com>:
> This is more a date-formatting question and less to do with taglibs or el.

 Thank you!!
select to_char(interval,'HH24:MI:SS') resolved my problem.

 Best Regards,

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@tomcat.apache.org
For additional commands, e-mail: taglibs-user-help@tomcat.apache.org


Re: How to get short description of interval data by EL?

Posted by Stuart Thiel <st...@gmail.com>.
This is more a date-formatting question and less to do with taglibs or el.

You probably want to pull the epoch and then use standard
date-formatting that's readily available, or write a simple formatting
taglib if one doesn't already exist... something like this might help
for the former:
http://stackoverflow.com/questions/341384/how-to-convert-an-interval-like-1-day-013000-into-253000

On Thu, Sep 4, 2014 at 3:32 AM, Kazuaki Miyauchi <mi...@gmail.com> wrote:
>  Hi,
>
>  I'm making Web-DB program using JSTL on Tomcat and Postgres.
> In there, I'd like to show interval data using EL. But,
> ${rowSelect.interval} shows following long data.
>
> 0 years 0 mons 0 days 0 hours 13 mins 15.114 secs
>
> interval is data of interval type of Postgres.
>
>  How can I get normal expression such as "0:13:15" using EL?
>
>  Regards,                                                    Kazuaki Miyauchi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: taglibs-user-help@tomcat.apache.org
>



-- 
Stuart Thiel, P. Eng.

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@tomcat.apache.org
For additional commands, e-mail: taglibs-user-help@tomcat.apache.org