Format Both Date and Time in Medium Style : Format Date « JSTL « Java Tutorial






<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%@ taglib uri="http://java.sun.com/jstl/core-rt" prefix="c-rt" %><%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<html>
  <head>
    <title>Format Date</title>
  </head>

  <body>
    <c-rt:set var="now" value="<%=new java.util.Date()%>" />
    <fmt:formatDate type="both" dateStyle="medium" timeStyle="medium" value="${now}" />

  </body>
</html>
  Download:  JSTLFormatBothDateAndTimeMedium.zip( 1,225 k)








24.19.Format Date
24.19.1.Format time with default value
24.19.2.Format Date With Timezone
24.19.3.Format Date with Pattern
24.19.4.Format Date with Default Value
24.19.5.Format Both Date and Time with Default Style Specified
24.19.6.Format Both Date and Time in Short Style
24.19.7.Format Both Date and Time in Medium Style
24.19.8.Format Both Date and Time in Long Style
24.19.9.Format Both Date and Time in Full Style
24.19.10.Format Both Date And Time with Default value