q16marvin Posted November 14, 2012 Share Posted November 14, 2012 Hello,i wrote me class to get some dates for "Yesterday,Last Week and Last Month". Yesterday and Last Month works great, but Last Week give me in jasperserver the wrong date (-1 day). in ireport works great.here is the code: if("Last Week".equals(dateChoice)){ cal.setTime(new Date()); cal.add(Calendar.WEEK_OF_YEAR,-1); cal.set(Calendar.DAY_OF_WEEK,cal.getFirstDayOfWeek()); }Why is it not working in jasperserver?i read something to set the datasource timezone to defautl, but it also stands on default ... Link to comment Share on other sites More sharing options...
Solution q16marvin Posted November 14, 2012 Author Solution Share Posted November 14, 2012 i solved the problem, in my java class i have to set: cal.setFirstDayOfWeek(Calendar.MONDAY);because the jasperserver runs on a english windows server and the the week starts on sunday. thx! 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