selene.platt_1 Posted December 9, 2022 Share Posted December 9, 2022 I am trying to print a datestamp in an Excel Jaspersoft report with the time in 12-hour am/pm format. Under 'Dataset and Query', the database field (which is date format) has Class Type = java.sql.Date:In the table, under Text Properties, I am using the format 'MM/dd/yy hh:mm a', which is supposed to give me what I want:However, in the report, the timestamps are listed with military (24hr) time:What am I doing wrong? I should mention that I'm defining them as dates rather than strings so the user can sort them by date in the Excel file. Thanks in advance for any help - and please give specific instructions because I am not an expert at Jaspersoft Report!p.s. I am referring to this pattern guide: https://community.jaspersoft.com/wiki/date-and-time-patterns Link to comment Share on other sites More sharing options...
Scott Andersen Posted December 13, 2022 Share Posted December 13, 2022 The proper format is MM/dd/yy h:mm athe two hh gives you the 24 hr clock. Link to comment Share on other sites More sharing options...
selene.platt_1 Posted December 14, 2022 Author Share Posted December 14, 2022 Thanks, I had just assumed that two m's meant a 2-digit hour, e.g. 03:00. Interestingly, in the Excel output report, the time still looks like it's 24-hr until I click on a cell - then it appears as 12-hr. When I changed the cell formatting from Custom to Date and specified the correct format, the dates all displayed as I expected. Really odd. 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