Selecting and showing time-stamp in ADF using af:inputDate & af:convertDateTime

Sharing is Caring

Hello All
This post is about a very common & basic requirement for developers working on Oracle ADF
how to show & select time with date in ADF Faces ?
We use af:inputDate for showing Time-stamp in ADF, By default Date and Timestamp type of attributes looks like this

 

ADF provides a default converter (af:convertDateTime) to format date & timestamp field, we can define a pattern to change its format & to show time selector in the calendar box, here I am going to show you that how can show time along with date in af:inputDate component.

Suppose pattern is- dd-MMM-yyy HH:mm:ss, now see there is an hour/minute/second selector appears in the calendar box

 

you can change this pattern as per your format, suppose you want to show AM or PM after time just use dd-MMM-yyy HH:mm:ss a

showing time-stamp in ADF


See xml source of af:inputDate-

<af:inputDate label="Label 1" id="id1" contentStyle="width:250px;padding:5px;">
                        <af:convertDateTime pattern="dd-MMM-yyy HH:mm:ss a"/>
                    </af:inputDate>

this is how we can change the format of Date & Timestamp

Cheers 🙂 Happy Learning

Related Posts

5 thoughts on “Selecting and showing time-stamp in ADF using af:inputDate & af:convertDateTime”

  1. Thanks for useful information. I would like to know how can we get value from 1st date value to set 2nd date value without using java bean? For example if the user select start date as “2018/10/10” end date selection show date “2018/10/10” automatically. Is there any way we can archive this in ADF (Jdeveloper 11g)?

Leave a Reply

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