How to get the Current Date and Time in the Managed Bean?

In order to get the Current date and time in the managed bean, include the below method –

    * Get Current Date
    * @return
    public Date getCurrentDateTime()
  return new Date(new java.sql.Timestamp(System.currentTimeMillis()));

The above method getCurrentDateTime() returns the Date value.  You can use this method anytime, where you want the current Date and Time.

This entry was posted in ADF (Application Development Framework) and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s