- cdi
- components
- contexts
- converters
- el
- eventlisteners
- exceptionhandlers
- facesviews
- filters
- functions
- managedbeans
- push
- resourcehandlers
- search
- servlets
- taghandlers
- utils
- validators
- viewhandlers
- - now
- startup
- cdi
- components
- contexts
- converters
- el
- eventlisteners
- exceptionhandlers
- facesviews
- filters
- functions
- managedbeans
- push
- resourcehandlers
- search
- servlets
- taghandlers
- utils
- validators
- viewhandlers
- now
- startup
The builtin managed bean #{now}
returns you the
java.util.Date
instance representing the current time.
Demo
Raw Date#toString()
value of #{now}
: Sat Jul 02 14:12:19 CEST 2022
Formatted date using of:formatDate()
function: 2022-07-02 14:12:19
Demo source code
<p>
Raw <code>Date#toString()</code> value of <code>\#{now}</code>: #{now}
</p>
<p>
Formatted date using <code>of:formatDate()</code> function: #{of:formatDate(now, 'yyyy-MM-dd HH:mm:ss')}
</p>
<h:form>
<h:commandButton value="Refresh">
<f:ajax render=":demo" />
</h:commandButton>
</h:form>