santosh.audi19 Posted March 24, 2016 Share Posted March 24, 2016 Hi Everyone, Im trying to achieve this format 3/24/16 2:36:46 PM in Jasper , Could you help me out in Framing the Date Functions to achieve this.Regards,Santosh Link to comment Share on other sites More sharing options...
santosh.audi19 Posted March 24, 2016 Author Share Posted March 24, 2016 Hi Everone, I had a Try and this is workingnew SimpleDateFormat("dd-MM-yyyy HH:mm:ss a").format(new Date()) Link to comment Share on other sites More sharing options...
hozawa Posted March 24, 2016 Share Posted March 24, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now