JSP code to format the Date in Control Rule

JSP Code to format the date in Control rule

<%
try{
ClipboardProperty iDate = tools.getActive();
Date inDate = iDate.toDate();
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat(“dd/MMM/yyyy hh:mm:ss a z”);
String oDate = formatter.format(inDate);
%>
<%=oDate%>
<%
}
catch(Exception e){
}
%>

/* “dd/MMM/yyyy hh:mm:ss a”
dd – day
MMM – month in letter ex: Jan, Feb, …
yyyy – year
hh – hours
mm – minutes
ss – seconds
a – AM/PM
z – Timezone
*/

Leave a Reply

Your email address will not be published. Required fields are marked *