Jump to content
We've recently updated our Privacy Statement, available here ×

How to frame Date to get this Format 3/24/16 2:36:46 PM


santosh.audi19

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

That's very strange. Your Java has a but because "yyyy" would return "24-03-2016" instead of "3/24/16"!

What you want is 

new SimpleDateFormat("M/dd/yy HH:mm:ss a").format(new Date())

 

Anyways, the proper way to do this in JasperReports is to set expression to "new Date()" and set pattern to "M/dd/yy HH:mm:ss a"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...